| | |
error C2447: '{' : missing function header (old-style formal list?) please help.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
error C2447: '{' : missing function header (old-style formal list?) please help.
0
#1 Apr 17th, 2008
C++ Syntax (Toggle Plain Text)
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; static const int password=1705898; int main; { int secondnumber; while(true) cout>>("Enter Password") cin<<(secondnumber) if(password = Enter Password) cout<<"Welcome Lukus"; else cout<<"Password Rejected"; system ("PAUSE") return 0; }
i am getting the error C2447: '{' : missing function header (old-style formal list?) error.
Can anyone tell me where i am going wrong to eliminate this error. thanks
Last edited by Ancient Dragon; Apr 17th, 2008 at 12:37 pm. Reason: add code tags
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#2 Apr 17th, 2008
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#3 Apr 17th, 2008
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#4 Apr 17th, 2008
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#5 Apr 17th, 2008
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#6 Apr 17th, 2008
You need to add { and } when there are more than 1 lines within while statements
C++ Syntax (Toggle Plain Text)
while( <condition> ) { // some lines here } else { // more lines here }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#7 Apr 17th, 2008
C++ Syntax (Toggle Plain Text)
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; static const int password=1705898; int main() { int secondnumber; while(true); } cout>> ("Enter Password") cin<< (secondnumber); { if(password = Enter Password) cout<<"Welcome Lukus"; } else cout<<"Password Rejected"; { system ("PAUSE") return 0; }
errors:
line (10) : warning C4101: 'secondnumber' : unreferenced local variable
"(13) : error C2143: syntax error : missing ';' before '>>'
(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
(15) : error C2447: '{' : missing function header (old-style formal list?)
(20) : error C2059: syntax error : 'else'
(22) : error C2447: '{' : missing function header (old-style formal list?)
Last edited by Ancient Dragon; Apr 17th, 2008 at 1:39 pm. Reason: please learn to use code tags
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#8 Apr 17th, 2008
braces are still wrong -- they are backwards and the closing } is on the wrong place. Re-read my previous post again. You need to count the number of opening and closing braces and make sure there is a } for every { (and vice versa)
line 11: delete the semicolon at the end of that while statement
line 11: delete the semicolon at the end of that while statement
Last edited by Ancient Dragon; Apr 17th, 2008 at 1:42 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#9 Apr 17th, 2008
This is how to format the code. I also change a couple of other errors -- you had << and >> reversed. cout uses << and cin uses >>, you have them backwards.
>>if(password == Enter Password)
That is also wrong but I don't know how you need to correct it.
Help with Code Tags (Toggle Plain Text)
>>if(password == Enter Password)
That is also wrong but I don't know how you need to correct it.
Help with Code Tags (Toggle Plain Text)
C++ Syntax (Toggle Plain Text)
int main() { int secondnumber; while(true) { cout << "Enter Password"; cin >> secondnumber; if(password == Enter Password) { cout<<"Welcome Lukus"; } else { cout<<"Password Rejected"; } } system ("PAUSE") return 0; }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Re: error C2447: '{' : missing function header (old-style formal list?) please help.
0
#10 Apr 17th, 2008
![]() |
Similar Threads
- error C2447: '{' : missing function header (old-style formal list?) (C++)
- error C2447: '{' : missing function header (old-style formal list?) (C++)
- error C2447: '{' : missing function header (old-style formal list?) (C++)
- error C2447: missing function header (old-style formal list?), what does this mean?! (C++)
Other Threads in the C++ Forum
- Previous Thread: Passing argc and argv to function
- Next Thread: Switch Case
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library linker list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






