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
/* 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 :icon_exclaim:
alredy many thanks to those who want to help!