Alright, i hope someone can give me a straight answer.
How do i export integers to another function?
Because when i compile and run this code, i get an error telling me:
"
12 D:\test.cpp `numberr' undeclared (first use this function)
The code i used was kinda like this :
int Plus()
{
int all = number + number2;
return all;
}
int main()
{
int number;
int number2;
int do;
cout << "type in a number" << endl;
cin >> number;
cout << "another number" << endl;
cin >> number2;
cout << "+, - , * or /?" << endl;
cin >> do;
if(do == "+")
{
Plus();
}
system("pause");
}
I just learned how to use functions so don't blame me for newbie errors.
So just answer my main question:
How do i use variables that's in main(); in Plus(); ?
BTW, the code is just a test.