Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void string::Insert(char *s, int index) {
- int slen = strlen(s);
- int len = Length() + slen;
- char *temp = new char[len];
- strncpy(temp, string_, index);
- temp = strcat(temp, s);
- temp = strcat(temp, &string_[index]);
- freeMem();
- getMem(len);
- string_ = strcpy(string_, temp);
- delete [] temp;
- string_[len] = '\0';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement