F
Fernando Barsoba
Hi,
I decided to start a new topic about my memory allocation question. One
of the answers was that variable length arrays are possible using C99. I
found this topic that also mentions it.
http://groups.google.com/group/comp...variable+length+array&rnum=2#f5335d22d6e6fb34
I did some test, but I get strange results:
int size_array = sizeof(struct ip) + cnf->msg_length;
unsigned char packet[size_array];
And then, when asking the size of the 'packet' variable I get 4. How is
that? It should be another number (31).. but I guess i'm getting the
size of type unsigned char. Right?
Thanks,
FBM
I decided to start a new topic about my memory allocation question. One
of the answers was that variable length arrays are possible using C99. I
found this topic that also mentions it.
http://groups.google.com/group/comp...variable+length+array&rnum=2#f5335d22d6e6fb34
I did some test, but I get strange results:
int size_array = sizeof(struct ip) + cnf->msg_length;
unsigned char packet[size_array];
And then, when asking the size of the 'packet' variable I get 4. How is
that? It should be another number (31).. but I guess i'm getting the
size of type unsigned char. Right?
Thanks,
FBM