This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: static array size


Hello,

Is the following example legal in current GCC compilation for C program? I thought the static array allocation can only used by a defined constant such as char buf[MAX_SIZE], where #define MAX_SIZE 10?

void DoSomthing(int size)
{
      char buf[size];

...... do something ....

}

Thanks.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]