c++ - Initialization of arrays at the time of declaration not supported?
- Stefano (8/8) Mar 18 2006 This C line should work:
- Bertel Brander (14/19) Mar 18 2006 I have no problem with this code:
This C line should work: int grades[NUM_STUDENTS][NUM_TESTS] = { {55, 60, 65}, {95, 90, 85} }; But i get errors using dmc. Is array initialization at the time of declaration not supported? Thank you Best Regards Stefano
Mar 18 2006
Stefano wrote:This C line should work: int grades[NUM_STUDENTS][NUM_TESTS] = { {55, 60, 65}, {95, 90, 85} }; But i get errors using dmc. Is array initialization at the time of declaration not supported?I have no problem with this code: #include <stdio.h> #define NUM_STUDENTS 2 #define NUM_TESTS 3 int main() { int grades[NUM_STUDENTS][NUM_TESTS] = {{55, 60, 65}, {95, 90, 85}}; } Which errors du you get? -- Absolutely not the best homepage on the net: http://home20.inet.tele.dk/midgaard But it's mine - Bertel
Mar 18 2006