S**Y 发帖数: 136 | 1 I have a class A with a public static member
class A{
...
public:
static int i;
private
int j,k;
char* s;
....
}
in the main program, I have
A a1;
I understand that a1 will be in stack, a1's j, k will be in stack too; s wil
l point to a dynamically allocated heap(if new-ed).
but how about the static variable i? It belongs to class A. Will it be in th
e data section?
Thanks a lot. | a**********s 发帖数: 588 | 2 Yes, it will be in the data segment, not in the stack. | S**Y 发帖数: 136 | 3 thanks.
【在 a**********s 的大作中提到】 : Yes, it will be in the data segment, not in the stack.
|
|