Where are the string and char array stored?
int main ()
{
int a = 0; //This should be stack
char* p = "hello"; // why this is on the static?
char k[10] = "hello"; //on the stack?
}
A textbook says that the char pointer (Char* a) will be stored on the static, from my understanding of "static memory", only these 2 will be stored on the static memory:
int a=0;// will on the static
int main()
{
static xxxxx; //will on the static.
}
ato something elseint aandchar a[10]char* a. Andchar a[10]is an error sinceais already defined asint.