Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <ctype.h>
- int main() {
- char a[5] = "hello";
- char *cpy = malloc(strlen(a) * sizeof(char) + 1);
- strcpy(cpy, "hello");
- printf("%s %lu \n", cpy, sizeof(char));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement