hey, could someone plz tell me why this aint working for me? :S
#include <iostream.h>
void multiply(int &aa,int &bb);
int main()
{
int a,b;
long int answer;
cout<<"Enter two numbers seperated by space\n";
cin>> a >> b;
answer=multiply(a,b);
cout<<"\nThe product of those two number is "<<answer<<".";
}
void multiply(int &aa,int &bb)
{
return aa*bb;
}
Name:
Anonymous2007-12-09 17:45
Looks like you are using Sepples, that won't work; you'll have to switch to C.
template < class T, class R >
R multiply( const T& a1, const T& a2 ) {
return a1 * a2;
}
int main( int argc, char* argv[] ) {
typedef int InNumType;
typedef long OutNumType;
typedef OutNumType( *FuncType )( InNumType, InNumType );
FuncType typedMultiply = &multiply< InNumType, OutNumType >;
InNumType n1, n2;
std::cout << "Enter two numbers separated by a space." << std::endl;
std::cin >> a >> b;
std::cout << std::endl << "The product of those two numbers is " << typedMultiple( n1, n2 ) << "." << std::endl;
return 0;
}
Didn't bother to test it, probably won't compile so don't bother. I should have used 100% more partial class specialization and boost.function but fuck it I'm having a wank with my good hand.
Name:
Anonymous2009-03-18 2:52
I wants lots and lots of some delectable pot!
Marijuana MUST be legalized.
Name:
Anonymous2010-12-17 1:18
Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?
If you answered "Yes" to all of the above questions, then GNAA(GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!