Hi
Is this code correct.
main()
{
char *p;
p = "This is what is assigned first";
printf("%s\n", p);
p = "This is second string";
printf("%s\n", p);
}
This piece of code works fine.
What I want to know is this acceptable??
Where are the literal strings allocated memory the stack/heap initialised memory etc... Can you give a memory map for this?
thanks
Is this code correct.
main()
{
char *p;
p = "This is what is assigned first";
printf("%s\n", p);
p = "This is second string";
printf("%s\n", p);
}
This piece of code works fine.
What I want to know is this acceptable??
Where are the literal strings allocated memory the stack/heap initialised memory etc... Can you give a memory map for this?
thanks