Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *strcat(char *destination, const char *source) {
- int i = 0, j = 0;
- while (destination[i] != char(0) && source[j] != char(0)) {
- if (destination[i] != char(0)) {
- i++;
- }
- if (source[j] != char(0)) {
- j++;
- }
- }
- int t = i + j - 1;
- j = 0;
- while (i != t) {
- destination[i] = source[j];
- i++;
- j++;
- }
- destination[t] = char(0);
- return destination;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement