2-D Array Initialization error (Header File)
Hello,
I want to use the contents of a 2-D array in different .cpp files
So, I taught of doing it with a header file.
Code:
(In XYZ.h)
int abc[5][20];
abc[5][5]=98; // This is not valid
Direct initialization outside a funtion is Not Allowed and so "abc[5][5]=98;" is giving an error.
I want to use that array in different .cpp files
So how should I do this?
Also i have another question
If my array is filled in this way
abc[0][] -- Has 20 elements
abc[1][] -- actually needs only abc[1][10] (10 elements are enough)
So is it possible to dynamically do it to save that extra space used.
Thanks :)