char *a = "hello"; char b[] = "hello"; char *c = malloc(12); What do these do, what's the difference in where the memory is stored?
Sigiloso
char *a = "hello"; // pointer a on the stack, point to the "hello", which in in the static memory zone char b[] = "hello"; // char array b on the stack, make a copy of "hello“ to array b char *c = malloc(12); // allocate 12 bytes space on the heap, and pointer c on the stack pointing to the allocated space