Error :Code:
const usi iSize= SizeOfMyFile(File);
char sFile[iSize];
1-Expected constant expression
2-cannot allocate an array of constant size 0
3-unknows size
Printable View
Error :Code:
const usi iSize= SizeOfMyFile(File);
char sFile[iSize];
1-Expected constant expression
2-cannot allocate an array of constant size 0
3-unknows size
In visual basic you cant declare Consts with arguments
cause it has no preprocessor.
Is that still true in C++?
Evan is right. You have to use some immediate value that the compiler can resolve. Not something that arises only during run-time.
I hate that grrr
You have to use new if you want to have an array of dynamic or runtime-determined size.
Tell me if that good :
Code:const usi iSize= SizeOfMyFile(File);
char sFile = new char[iSize];
if the first line is inside a function it's ok, else remove the const.
ok thank you :)