opennms
+ Reply to Thread
Results 1 to 2 of 2

Thread: C/C++ programing help!

  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
    Posts
    623
    I just ******* 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.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

+ Reply to Thread

Similar Threads

  1. Pascal programing
    By gani in forum Programming
    Replies: 8
    Last Post: 10-19-2019, 08:02 AM
  2. programing language
    By Samson in forum Programming
    Replies: 21
    Last Post: 04-03-2017, 08:46 AM
  3. problem in programing
    By minaadel1994 in forum Programming
    Replies: 0
    Last Post: 02-11-2009, 03:30 PM
  4. Programing
    By Tr_Ms in forum Programming
    Replies: 10
    Last Post: 06-12-2007, 01:56 PM
  5. Learning programing want to help!
    By stl_rn in forum Viruses and Trojans
    Replies: 9
    Last Post: 10-04-2006, 03:59 PM

Posting Permissions

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