Assume you have the code:
int main(void)
{
int a=10;
char b[10]="HELLO";
const int x=10;
return 0;
}
Please correct me if I am wrong:
"a" will be stored in the stack only (not in data segment at all) with its value(10)
"b" will be stored as a pointer (because I think the array is a pointer to the first element) in the stack and "HELLO" will be stored in heap (like if we are using malloc).
"x" can be stored in data, stack, or text depending on compiler.