Hey guys,
I am wondering if it is possible to receive a value from a command line that creates an array of that size?
Is the more 'sophisticated' method of doing this to use malloc()?
Thanks.
Hey guys,
I am wondering if it is possible to receive a value from a command line that creates an array of that size?
Is the more 'sophisticated' method of doing this to use malloc()?
Thanks.
Yes, it is possible.Originally Posted by Cell
I am not sure how 'sophisticated' it is, but it is the usual way. In C99 you also have the option of variable length arrays.Originally Posted by Cell
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Thank you.
So if I am using a VLA, is it as simple as:
Because I have been having some issues using this.Code:int TEST; printf("Message size?\n"); scanf("%d", &TEST); int string[TEST];
Thanks.
Is C99 mode standard in gcc?
If it compiles without warnings with you scattering variables throughout your code like that, then yes, it's in C99 (or some bastardized) mode.
Quzah.
Hope is the first step on the road to disappointment.