March 18, 2006 Initialization of arrays at the time of declaration not supported? | ||||
---|---|---|---|---|
| ||||
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 |
March 18, 2006 Re: Initialization of arrays at the time of declaration not supported? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefano | 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 |
Copyright © 1999-2021 by the D Language Foundation