作者star1327p (sin30t)
看板EE_DSnP
标题[问题] 如果compile 没过怎麽办
时间Tue Jan 22 20:06:48 2008
如果compile 没过怎麽办?
我的程式码,在最前面几行就出状况,
#include <iostream>
#include <iomanip>
#include <cstring>
#include <fstream>
#include <conio.h>
#include <cstdlib>
#include "Editor.h"
using namespace std;
Error message: expected unqualified-id before "namespace"
不太了解
还有另一个问题↓
void Editor::commandMode() // ask the user to put in the command
{
if (quitOrNot == false)
{
return;
printCommandLine();
}
while (true)
{
getline(cin,directive);
switch(directive)
{
case 'e': cout << endl; editMode(); break;
case 'h': cout << endl; help(); pause(); break;
case 'n': newFile(); break;
case 'o': openFile(); break;
case 'p': printText(); break;
case 'q': quit(); break;
case 's': saveFile(); break;
case 'S': saveFileAs(); break;
default:
system("cls");
cout << "INVALID directive input! Please input AGAIN!" << endl;
break;
} // end switch
} // end else
commandMode();
} // end function commandMode
Compiler 说 commandMode不能被overloaded
可是我觉得我没有overload它
以上两个问题,请好心人士回答,小的在此先说感谢喔
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.115.181.213
1F:推 timrau:Editor.h有没有用#ifndef #define #endif包起来? 01/22 20:08
2F:→ star1327p:why? 01/22 20:31
3F:→ ilway25:有时候显示a.cpp错,但a.cpp include b.h,b.h又include c.h 01/22 22:53
4F:→ ilway25:错可能在 c.h ... 我曾经这样 debug 很久.. 01/22 22:53
5F:→ ilway25:ps.你的commandmode是无止尽recursion?? 记忆体会被吃光.. 01/22 23:01