So if I do:
char * a = "hello";
"hello" is stored in the RODATA section and a points to it. If I do:
char a[10] = "hello";
"hello" is stored on the STACK in an array of 10 bytes called a.
What happens when I do:
char * a[10] = {"hello", "hi"}
So, we have an array of 10 character pointers which will be stored on the STACK. But what about the string literals? Do they go in the RODATA section?
Also, does the same thing happen with argv
?