Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- //
- //
- //
- #include "string.h"
- #include <cassert>
- int main()
- {
- {
- String str("Hello friend");
- assert(str.getsize() == MaxString);
- str.reallocate(60);
- assert(str.getsize() == 60);
- }
- {
- String str("Hey");
- assert(str.getsize() == MaxString);
- str.reallocate(2);
- assert(str.getsize() == 4);
- }
- {
- String str("Hello venix");
- assert(str.getsize() == MaxString);
- str.reallocate(20);
- assert(str.getsize() == 20);
- }
- std::cout << "Complete testing string's reallocate function!" << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment