Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- char* string_concat(const char* lhs, const char* rhs) {
- const size_t storage_size = strlen(lhs) + strlen(rhs) + 1;
- char* storage = malloc(storage_size);
- strcpy(storage, lhs);
- strcat(storage, rhs);
- return storage;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement