It's visual C++ 5 code (from a book), and I'm using a VC++ 6 compiler. That could be causing the errors, I don't know. Here's my code:
#include <iostream.h>
double addtwo(int x, double y);
int main(void)
{
int two = 2;
double number = 0;
cout << "Choose a number." << endl;
cin >> number;
cout << endl
<< "Your number plus 2 = "
<< addtwo(int two, double number); <-----All three errors
cout << endl;
return 0;
}
double addtwo(double x, int y)
{
y += x;
return y;
}
The errors I get are these: 1) Syntax Error: missing ')' before type 'int'
2) 'addtwo' function does not take 0 parameters
3) Syntax Error: ')'
Little help?
#include <iostream.h>
double addtwo(int x, double y);
int main(void)
{
int two = 2;
double number = 0;
cout << "Choose a number." << endl;
cin >> number;
cout << endl
<< "Your number plus 2 = "
<< addtwo(int two, double number); <-----All three errors
cout << endl;
return 0;
}
double addtwo(double x, int y)
{
y += x;
return y;
}
The errors I get are these: 1) Syntax Error: missing ')' before type 'int'
2) 'addtwo' function does not take 0 parameters
3) Syntax Error: ')'
Little help?