Small and seeminly easy program won't compile.........Help!!!!!!!

This is a discussion on Small and seeminly easy program won't compile.........Help!!!!!!! within the C++ Programming forums, part of the General Programming Boards category; #include <iostream>//objective: to obtain two numbers divide and return value //using a function short int x, y; int a; int ...

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Arrow Small and seeminly easy program won't compile.........Help!!!!!!!

    #include <iostream>//objective: to obtain two numbers divide and return value
    //using a function
    short int x, y;
    int a;

    int main()
    {

    unsigned int Divide( unsigned short x, unsigned short y);

    using namespace std;
    cout<<"Please enter one number";
    cin>>x;
    cout<<"Please enter another number"<<endl;
    cin>>y;
    int answer;
    answer=Divide(x,y);
    cout<<"The answer is \t"<<answer<<endl;

    cin>>a;
    return 0;
    }


    unsigned int Divide ( unsigned short x, unsigned short y)
    {
    return x/y;
    }
    /*################################# */

    COMPILER AND LINKER OUTPUT:
    C:\WINDOWS\TEMP\ccFZL8fb.o(.text+0xca):day5ex~1.cp p: undefined reference to `Divide(unsigned short, unsigned short)'
    Last edited by incognito; 11-16-2001 at 04:50 PM.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    I already got it

    Thanks anyways....!!!!!!
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21