J
junky_fellow
Guys,
Consider the following snippet of code:
int main(VOID)
{
static ushort fractionalValue[]={
0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
250, 333, 666, 750, 0, 0
};
ushort nonStatic[] = {
0, 100, 200, 300, 400
}
}
I am using gcc over cygwin. I want to know where the storage for
"fractionalValue" would be allocated (stack or data segment) ?
Also, where the storage for "nonStatic" would be allocated (again
stack or data segment) ?
Also, if storage is allocated on stack for any of them, how the values
that
were initialized at compile time are obtained ? I mean to there have
to be
some space allocated in th executable during compile time, where the
initialized values should be stored.
Or the compiler generate a code, that would allocate space on the
stack and
put all the initial values on the stack ?
thanks for any help..
Consider the following snippet of code:
int main(VOID)
{
static ushort fractionalValue[]={
0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
250, 333, 666, 750, 0, 0
};
ushort nonStatic[] = {
0, 100, 200, 300, 400
}
}
I am using gcc over cygwin. I want to know where the storage for
"fractionalValue" would be allocated (stack or data segment) ?
Also, where the storage for "nonStatic" would be allocated (again
stack or data segment) ?
Also, if storage is allocated on stack for any of them, how the values
that
were initialized at compile time are obtained ? I mean to there have
to be
some space allocated in th executable during compile time, where the
initialized values should be stored.
Or the compiler generate a code, that would allocate space on the
stack and
put all the initial values on the stack ?
thanks for any help..