| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
In gcc 3.3, the following code produces an error:
const int k_my_array_size = 3;
const int g_my_array [k_my_array_size] = { 1,2,3 };
file:line: error: variable-size type declared outside of any function
file:line: error: variable-sized object may not be initialized
This is a legal (and recommended) C++ construction. Is there a way to convince gcc to allow it in C, or do I just give up and use a #define?
| References: | |
| >gcc and using constants in array declarations (From: Andrew White <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.