![]() |
errors in compiling
hello everyone
i have a problem with the below code it gives me that there are 5 errors: Compiling... asdfsa.cpp c:\documents and settings\ahmed aburumman\desktop\ljdf\asdfsa.cpp(9) : error C2258: illegal pure syntax, must be '= 0' c:\documents and settings\ahmed aburumman\desktop\ljdf\asdfsa.cpp(9) : error C2252: 'MAX' : pure specifier can only be specified for functions c:\documents and settings\ahmed aburumman\desktop\ljdf\asdfsa.cpp(10) : error C2065: 'MAX' : undeclared identifier c:\documents and settings\ahmed aburumman\desktop\ljdf\asdfsa.cpp(10) : error C2057: expected constant expression c:\documents and settings\ahmed aburumman\desktop\ljdf\asdfsa.cpp(10) : warning C4200: nonstandard extension used : zero-sized Array in struct/union c:\documents and settings\ahmed aburumman\desktop\ljdf\asdfsa.cpp(11) : error C2229: Class 'stack' has an illegal zero-sized Array Error executing cl.exe. asdfsa.obj - 5 error(s), 1 warning(s) Can somebody help?(im using a microsoft visual c++ 6.0 compiler if this means anything) Code:
|
Re: errors in compiling
Must be a compiler bug. It doesn't like "static const int MAX=10;", but it seems OK to me, and it compiles OK in Visual Studio 2005.
|
Re: errors in compiling
mmmm
i downloaded visual c++ 2008 and i didnt even know how to run the program.. could u plz send me a screen shot of the program when executed? |
Re: errors in compiling
There's nothing to give you a screen shot of; I only included enough in the code to test the MAX definition. The following code compiled in VS2005, and ran:
Code:
class stack |
| All times are GMT +5.5. The time now is 16:15. |