Jan 18, 2009 at 1:18pm UTC
Hello,
my program have two errors which are error C2601 && fatal error C1004.
and these are saying that;
error C2601: 'main' : local function definitions are illegal
fatal error C1004: unexpected end of file found
I cannot fix these problems!
and my code is like as follows;
int main()
{
string mword = "";
string newword = "";
string syl = "";
int pointer = 0;
int len = 0;
cout << "Enter a word:" << endl;
cin >> mword;
len = mword.length();
pointer = mword.length()-1;
newword=rest(mword, pointer);
cout << newword << endl;
return 0;
}
Jan 18, 2009 at 2:37pm UTC
"local function definitions are illegal" means that you've attempted to define a function while inside of another function. Define it outside of all other functions.
Jan 18, 2009 at 5:11pm UTC
ok, I understand what you mean but I still cannot see anything like you said in my code :\
Jan 18, 2009 at 8:55pm UTC
look where you've defined the rest function, because you haven't defined a function in main.
Jan 19, 2009 at 6:54am UTC
Yes. My guess is that you probably forgot and ending curly brace } at the end of a function definition elsewhere.
Last edited on Jan 19, 2009 at 6:55am UTC
Jan 19, 2009 at 9:11am UTC
Finally I saw my mistake :)
It was in my one of other functions that I forgot an ending curly brace as Zhuge said..
Thank you.