| | |
error C2447: '{' : missing function header (old-style formal list?)
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Solved Threads: 0
hello, i have found some other with this problem but it diddent solfe it for me.
Thats why i ask it here,
I am trying to learn the langue c++ i write in Visual studio 2005 and 2008 pro
this is my first little program byside hello world and calculater.
I get 2 warningings and one error
are the errors
1>c:\documents and settings\ampieper\mijn documenten\c\calculatortest\calculatortest\calcu.cpp(10) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\documents and settings\ampieper\mijn documenten\c\calculatortest\calculatortest\calcu.cpp(43) : warning C4129: ' ' : unrecognized character escape sequence
1>c:\documents and settings\ampieper\mijn documenten\c\calculatortest\calculatortest\calcu.cpp(64) : warning C4129: ' ' : unrecognized character escape sequence
bevore the warnings ware errors too, then i put some " "next to the other txt and removed .txt from the strings
then they turned into warning
what it actualy is i dont know i do remeber wen i tried to do such same ting with html and php it diddent work also with string, that is solfed too just c++ now
the last error at row 10 "{"
I have tried removing from row 9 the ; and adding a > infront or >> as i reed in other posts
that gave me some more errors (sintax error) mainly
if its posible explain me also how you/ or howto solfe this problem please.
i'm info thirsty
alredy many thanks to those who want to help!
Thats why i ask it here,
I am trying to learn the langue c++ i write in Visual studio 2005 and 2008 pro
this is my first little program byside hello world and calculater.
I get 2 warningings and one error
are the errors
1>c:\documents and settings\ampieper\mijn documenten\c\calculatortest\calculatortest\calcu.cpp(10) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\documents and settings\ampieper\mijn documenten\c\calculatortest\calculatortest\calcu.cpp(43) : warning C4129: ' ' : unrecognized character escape sequence
1>c:\documents and settings\ampieper\mijn documenten\c\calculatortest\calculatortest\calcu.cpp(64) : warning C4129: ' ' : unrecognized character escape sequence
/* try 1 to make a calculator in console and to store the information */ #include <iostream> // includes iostream #include <fstream> // ellows the program to write and reed files #include <string> using namespace std; int main (); { string item; // what item item = input1); string what; // what do you want to do ? what = input2; string listi; // list of items in storage listi = input3; string listu; // list of users listu = input4; string ae; ae = input10; ifstream edit (item".txt"); ofstream reed (item".txt"); long input1; long input2; long input3; long input4; long input10; int a; cout << "do you want to withdraw or deposite?" << endl; // TODO add output!! cout << "W = withdraw / d = deposite / i = itemlist / u = userlist" << endl; cin >> input2 ; // what do you want to do? cout <<"what do you want to withdraw"<< endl; // asking what item your looking for cin >> input1 ; // what item are you looking for? if (what=w()) { while (! " with\ "reed".aof"()); // notsure if its good here ( opening a folder and file ) { getitem (reed,item) cout <<"you have" item << endl; reed.close(); } cout << "how many do you want?" << endl; cin >> input10; item - input10 = a ; a < 0 cout << "ERROR" << endl; // look if its posible a = 0 cout << "WARNING! LAST ONE!" << endl; // Give warning if it was the last one if (edit.is_open()) { edit << item"\n"; edit << a"\n"; edit.close(); } else cout << "ERROR!" << endl; } if else (what=d()) // probleem bij het openen als het betsand nog niet bestaat { while (! "depo\ "reed".aof"()); // notsure if its good here ( opening a folder and file ) { getitem (reed,item) cout <<"you have" item << endl; reed.close(); } cout << "how many do you want to deposite?" << endl; cin >> input10; item + input10 = a ; a < 0 cout << "ERROR" << endl; // look if its posible a = 0 cout << "WARNING! LAST ONE!" << endl; // Give warning if it was the last one if (edit.is_open()) { edit << item"\n"; edit << a"\n"; edit.close(); } else cout << "ERROR!" << endl; } else cout << "ERROR!" << endl; return 0; }
bevore the warnings ware errors too, then i put some " "next to the other txt and removed .txt from the strings
then they turned into warning
what it actualy is i dont know i do remeber wen i tried to do such same ting with html and php it diddent work also with string, that is solfed too just c++ now
the last error at row 10 "{"
I have tried removing from row 9 the ; and adding a > infront or >> as i reed in other posts
that gave me some more errors (sintax error) mainly
if its posible explain me also how you/ or howto solfe this problem please.
i'm info thirsty
alredy many thanks to those who want to help!
>int main ();
Remove the semicolon.
>while (! " with\ "reed".aof"());
I can't imagine what you're trying to do here, but it's probably this:
You don't want to close the file in the loop that reads it. Also, using eof() as a loop condition is a bad idea. It would be better for getitem to return a success or failure flag and use that as the loop condition.
Remove the semicolon.
>while (! " with\ "reed".aof"());
I can't imagine what you're trying to do here, but it's probably this:
C++ Syntax (Toggle Plain Text)
while ( !reed.eof() )
I'm here to prove you wrong.
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Solved Threads: 0
while (! "with\ "reed".aof"());with\ is a folder,
notsure if its posible too
Thanks alot
for the reply i go try it out now! •
•
Join Date: Mar 2008
Posts: 4
Reputation:
Solved Threads: 0
Hmm
I tryed with semicolon and with out
with it gives me 2 errors
The warnings stay the same.
but will find someting for it
its more about the errors
hmm is there maybe a include file missing for the > or maybe its becouse i am using visual studio ?
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(9) : error C2059: syntax error : '>'
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(10) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(43) : warning C4129: ' ' : unrecognized character escape sequence
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(64) : warning C4129: ' ' : unrecognized character escape sequence
and with out 3 then it says that ( ; ) is missing
C++ Syntax (Toggle Plain Text)
>int main ();
with it gives me 2 errors
The warnings stay the same.
but will find someting for it

its more about the errors
hmm is there maybe a include file missing for the > or maybe its becouse i am using visual studio ?
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(9) : error C2059: syntax error : '>'
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(10) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(43) : warning C4129: ' ' : unrecognized character escape sequence
1>c:\users\alex\desktop\program\calculatortest\calculatortest\calcu.cpp(64) : warning C4129: ' ' : unrecognized character escape sequence
and with out 3 then it says that ( ; ) is missing
•
•
Join Date: Jul 2005
Posts: 1,738
Reputation:
Solved Threads: 281
Do yourself a favor, never write a whole program and then try to debug it. You'll just drive yourself crazy. Start like this:
when that compiles and runs as expected then go to this:
When you get that to compile and run , then add another line or two and keep repeating.
That doesn't mean you shouldn't write out the flow of the program or even some psuedocode for the whole program at once--you should. But with the actual code, go in ministeps, at least until you have a fair amount of experience.
C++ Syntax (Toggle Plain Text)
#include <iostream> // includes iostream #include <fstream> // ellows the program to write and reed files #include <string> using namespace std; int main (); { return 0; }
when that compiles and runs as expected then go to this:
C++ Syntax (Toggle Plain Text)
#include <iostream> // includes iostream #include <fstream> // ellows the program to write and reed files #include <string> using namespace std; int main () { string item; //what item item = input1); return 0; }
That doesn't mean you shouldn't write out the flow of the program or even some psuedocode for the whole program at once--you should. But with the actual code, go in ministeps, at least until you have a fair amount of experience.
![]() |
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?), what does this mean?! (C++)
Other Threads in the C++ Forum
- Previous Thread: problem in hybrid inheritance
- Next Thread: Link MinGW to glib in windows
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






