-
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!!!!
-
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.
-
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 <iostream.h>
#include <stdio.h>
int mult;
int mult2;
//int result;
int main()
{
cout << "Please enter a number:";
cin >> mult;
cout << "Please enter a second number:";
cin >> mult2;
// Imultiply(mult,mult2);
cout << "the result is: " << 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">
-
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.
-
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
-
Oh yea, that would cause a problem. My bad for not seeing it...
-
Glad ya got it figured out, I was away for a few days visiting my parents.