server monitoring


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    minaadel1994 Guest

    Lightbulb 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

  2. #2
    Join Date
    Jan 2005
    Location
    <(o)><(o)>
    Posts
    623
    I just skimmed over the code and it appears you forgot a "(" in one of your functions.

    Code:
    int sub x, int y)
    should be

    Code:
    int sub(x, int y)
    after reading more of your code looks like it should be

    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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts