For some reason I am getting a lot of errors in what I thought would be a fairly simple application
Here are the errors that I am getting (there are 12 of them and it is really stupid):Code:#include <afxwin.h> #include <vector> class COurApp : public CWinApp { public: virtual BOOL InitInstance(); }; class COurWnd: public CFrameWnd { public: COurWnd() { Create(0, "Charles is god"); } }; BOOL COurApp::InitInstance() { m_pMainWnd = new COurWnd; m_pMainWnd->ShowWindow(m_nCmdShow); return true; } std::vector<COurApp*> ApplicationVector; for(int NumOfWindows = 0; NumOfWindows < 5; NumOfWindows++) { ApplicationVector.push_back(new COurApp); }
--------------------Configuration: simplewindow - Win32 Debug--------------------
Compiling...
smpwnd1.cpp
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ';' before 'for'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ')' before ';'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ';' before '<'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2501: 'NumOfWindows' : missing storage-class or type specifiers
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ';' before '<'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ';' before '++'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2501: 'NumOfWindows' : missing storage-class or type specifiers
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2086: 'NumOfWindows' : redefinition
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ';' before '++'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2059: syntax error : ')'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2143: syntax error : missing ';' before '{'
C:\Documents and Settings\04thibaultc\Desktop\simplewindow\simplewi ndow\smpwnd1.cpp(26) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.
simplewindow.exe - 12 error(s), 0 warning(s)