+ Reply to Thread
Results 1 to 2 of 2
Thread: C/C++ programing help!
-
05-02-2008, 08:46 AM #1minaadel1994 Guest
C/C++ programing help!
hi im a newbie! and im learning C++/C but i got difficulties i wanna make a calculator! and in the same time i want the program to open in windows mode not in cmd (command prompt ) u know the black screen thing! with white text..... i already html/dhtml i must say i know whats in all the tutorials but i don't think they r complete here is the code i need help in :
#include <iostream>
using namespace std;
int mult (int x , int y);
int main()
{
int x;
int y;
cout<<"put the number here: ";
cin>>x>>y;
cin.ignore();
cout<<"equals: "<<mult (x,y);
cin.get();
}
int mult (int x, int y)
{
return x * y;
}
ok this works but when i add this:
#include <iostream>
using namespace std;
int mult (int x , int y);
int main()
{
int x;
int y;
cout<<"put the number here: ";
cin>>x>>y;
cin.ignore();
cout<<"equals: "<<mult (x,y);
cin.get();
}
int mult (int x, int y)
{
return x * y;
}
{
int x;
int y;
cout<<"put the number here: ";
cin>>x>>y;
cin.ignore();
cout<<"equals: "<<sub,y);
cin.get();
}
int sub x, int y)
{
return x - y;
}
the error is:expected unqualified id before ' { ' token
what should i do any advices? any help or advice wud be good
-
05-06-2008, 11:56 AM #2
I just skimmed over the code and it appears you forgot a "(" in one of your functions.
should beCode:int sub x, int y)
after reading more of your code looks like it should beCode:int sub(x, int y)
Code:int sub(int x, int y)
Last edited by SyntaXmasteR; 05-06-2008 at 11:58 AM.
[url=http://www.syntaxmaster.info/tools/services.php]Speed Up Windows XP[/url]
[url=http://www.syntaxmaster.info/tools/ip.php]Get An Ip Address[/url]
[url=http://www.syntaxmaster.info/tools/base_converter.php]Base Converter[/url]
--------------------------------
[URL=http://www.boninroad.com/syntaxmaster/]Old Site[/URL]
[URL=http://www.syntaxmaster.info]Comming Soon[/URL]


Reply With Quote
