Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <cstdio>
- #define SYSTEMCODE 1
- int main()
- {
- char *str;
- /* Initial memory allocation */
- str = (char *) malloc(SYSTEMCODE + 5));
- strcpy(str, "tutorialspoint");
- printf("String = %s, Address = %u\n", str, str);
- /* Reallocating memory */
- str = (char *) realloc(str, 25);
- strcat(str, ".com");
- printf("String = %s, Address = %u\n", str, str);
- free(str);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement