1 | #include <stdlib.h> |
---|---|
2 | |
3 | int main(void) { |
4 | char *str; |
5 | int size = 9; //strlen("patatino") + 1 |
6 | str = (char *)malloc(size: sizeof(char)*size); |
7 | *(str+0) = 'p'; |
8 | *(str+1) = 'a'; |
9 | *(str+2) = 't'; |
10 | *(str+3) = 'a'; |
11 | *(str+4) = 't'; |
12 | *(str+5) = 'i'; |
13 | *(str+6) = 'n'; |
14 | *(str+7) = 'o'; |
15 | *(str+8) = '\0'; |
16 | return 0; |
17 | } |
18 |