Here comes my second question. It's probably got a really easy answer, but here's my code and error list (respectively):
Code:
#include "SimpleAssistant.h"
#include <string>
using namespace std;
int math (int x, int y);
int main();
{
int menu_choice;
int input;
int x;
int y;
cout<< "Hello. I'm your personal Simple Assistant.\n";
cin.get();
cout<< "Please select an option from the menu.\n";
cout<< "After carrying out an action, type '01' to make another choice or '00' to exit.'\n";
cout<< "1 = Multiply numbers\n";
cin>> input;
if (input==1)
{
cout<< "Please input two numbers to be multiplied.\n";
cin>> x >> y;
cin.get();
cout<< "The answer is: "<< math (x, y) <<"\n";
cin.get();
}
cin>> menu_choice;
if (menu_choice==01)
{
cout<< "Please select an option from the menu.\n";
cout<< "After carrying out an action, type '01' to make another choice or '00' to exit.'\n";
cin>> input;
if (input==1)
{
cout<< "Please input two numbers to be multiplied.\n";
cin>> x >> y;
cin.get();
cout<< "The answer is: "<< math (x, y) <<"\n";
cin.get();
}
}
if (menu_choice==00)
{
cin.get();
return 0;
}
cin.get();
}
Code:
------ Build started: Project: SimpleAssistant, Configuration: Debug Win32 ------
Compiling...
SimpleAssistant.cpp
c:\documents and settings\klope family\my documents\visual studio 2008\projects\simpleassistant\simpleassistant\simpleassistant.cpp(10) : error C2447: '{' : missing function header (old-style formal list?)
Build log was saved at "file://c:\Documents and Settings\Klope Family\My Documents\Visual Studio 2008\Projects\SimpleAssistant\SimpleAssistant\Debug\BuildLog.htm"
SimpleAssistant - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
P.S. Here's the contents of "SimpleAssistant.h":
Code:
#include <iostream>
int math (int x, int y)
{
return x * y;
}
I really can't see where the problem is. It says the "missing function header" is on line 10, but all that's on that line is a bracket--a properly placed bracket, I do believe, also. What's the problem here?