c++ newbie
Results 1 to 7 of 7

Thread: c++ newbie

  1. #1
    Registered User
    Join Date
    Mar 2001
    Location
    muskoka,ontario
    Posts
    385

    Post c++ newbie

    ok guys, im new to programming in c++, and im goofing around just trying to learn it while its slow at work on a sat afternoon...

    my problem is, ive written a little program that is trying to multiply 2 numbers together using a little function ive made just to learn how to do that stuff..

    and when i try to compile it, it gives me an error of
    'implicit declaration of function "int imultiply(...)"'

    and i would also like to mention that im doin the programming on a sunOS server that im telnetting into...

    the command line looks like this when i goto compile

    altair$ c++ math.c

    any help would be mucho appreciated!!!!
    Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.


    [geek code]
    v3.12
    GCS
    d- s: a-- C++>$ US>$ UL>$ P+ L+ E--- W++>$ N K- w O---- PS PE Y+ t+ 5++ X R tv+ b+ DI+ D+ G e h-- r+ y++
    [/geek code]

  2. #2
    Avatar Goes Here Radical Dreamer's Avatar
    Join Date
    Jan 2001
    Location
    Fairmont, West Virginia
    Posts
    4,866

    Post

    First of all, I would recommend getting a compiler on your machine, all the unix based compilers that I have used are very limited and are very hard to learn to use.

    Second of all, please post your code so that I may pick it to find the error.
    :::Asus A8N-Sli Premium:::AMD 3500+ @ 2.4ghz:::2x80GB 8mb cache RAID0 Array:::GeForce 7800GTX OC:::2GB Corsair XMS Memory:::500 Watt Enermax Liberty PSU:::16x Lite-on DVDRW:::

    Counter Strike Source Forum and Server @ http://www.nvpclan.com -=Ninjas Vs. Pirates=-

  3. #3
    Registered User
    Join Date
    Mar 2001
    Location
    muskoka,ontario
    Posts
    385

    Post

    here ya go R.D.

    like i said.. nothing major.. just something simple so that i can learn what im doing

    </font><blockquote><font size="1" face="Trebuchet MS, Verdana, Arial, Helvetica, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    #include &lt;iostream.h&gt;
    #include &lt;stdio.h&gt;

    int mult;
    int mult2;
    //int result;

    int main()
    {
    cout &lt;&lt; &quot;Please enter a number:&quot;;
    cin &gt;&gt; mult;
    cout &lt;&lt; &quot;Please enter a second number:&quot;;
    cin &gt;&gt; mult2;
    // Imultiply(mult,mult2);
    cout &lt;&lt; &quot;the result is: &quot; &lt;&lt; Imultiply(mult, mult2);
    return 0;
    }

    /* int Imulitply(int x, int y)
    {
    int result = x * y;
    return result;
    }
    */ </pre><hr /></blockquote><font size="2" face="Trebuchet MS, Verdana, Arial, Helvetica, sans-serif">
    Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.


    [geek code]
    v3.12
    GCS
    d- s: a-- C++>$ US>$ UL>$ P+ L+ E--- W++>$ N K- w O---- PS PE Y+ t+ 5++ X R tv+ b+ DI+ D+ G e h-- r+ y++
    [/geek code]

  4. #4
    Registered User migel628's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    99

    Post

    Aside for the Imultiply function being commented out, all I see wrong is that the function is misspelled Imulitply instead of Imultiply. That could be your issue.

  5. #5
    Registered User
    Join Date
    Mar 2001
    Location
    muskoka,ontario
    Posts
    385

    Post

    nope.. figgered out what the prob is..

    wasnt declaring the function up in the code under the #includes....

    did that and it compiled fine..

    thanx for all the help guys
    Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.


    [geek code]
    v3.12
    GCS
    d- s: a-- C++>$ US>$ UL>$ P+ L+ E--- W++>$ N K- w O---- PS PE Y+ t+ 5++ X R tv+ b+ DI+ D+ G e h-- r+ y++
    [/geek code]

  6. #6
    Registered User migel628's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    99

    Post

    Oh yea, that would cause a problem. My bad for not seeing it...

  7. #7
    Avatar Goes Here Radical Dreamer's Avatar
    Join Date
    Jan 2001
    Location
    Fairmont, West Virginia
    Posts
    4,866

    Post

    Glad ya got it figured out, I was away for a few days visiting my parents.
    :::Asus A8N-Sli Premium:::AMD 3500+ @ 2.4ghz:::2x80GB 8mb cache RAID0 Array:::GeForce 7800GTX OC:::2GB Corsair XMS Memory:::500 Watt Enermax Liberty PSU:::16x Lite-on DVDRW:::

    Counter Strike Source Forum and Server @ http://www.nvpclan.com -=Ninjas Vs. Pirates=-

Bookmarks

Posting Permissions

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