ok sorry about posting on an old topic but if i was to have a program that read a number from a file then created an array from tha tnumber how would or could i aaccomplish this. an example is like this:
assuming the file opened correctly and had no problems
Code:
fscanf(fPtr,"%d",&nHeigth);
fscanf(fPtr,"%d",&nWidth);
char chArray[nHeight][nWidth];
why would this be such a problem, i get the old cannot allocate an array of size 0 and expected constant expression when i try it. i know that the information that it is reading in is correct because i already checked that. is there an easier way or a way that works? i am using vc for this particular project.