I am trying to code the below program using overloaded function which give me output is the answer in correct or not for the three different question, the answers are already provided in the program all I have to check the answer and give the output statement if the answer is correct or incorrect, I am able to run the below mentioned code but the output is weired, please look at it and help me with this.
#include <cstdlib>
#include <iostream>
using namespace std;
void checkQuestion(int, string, bool);
int main(int argc, char *argv[])
{
int intAnswer = 3;
string stringAnswer = "Abraham Lincoln";
bool boolAnswer = true;
string result[]={"correct", "incorrect"};
void checkQuestion (int intAnswer);
if (intAnswer == 3)
{
cout << "This answer is " << result <<endl;
}
void checkQuestion (string stringAnswer);
if (stringAnswer == "Abrahim Lincoln")
{
cout << "This answer is " << result << endl;
}
void checkQuestion (bool boolAnswer);
if (boolAnswer == true)
{
cout << "This answer is " << result << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
Voila! Syntax-highlighting!