Ok, what I'm trying to do is have the user enter a command at the prompt, and on the right command a function is called.
Here's my code:
#include <iostream>
#include <stdlib.h>
void functionCall()
{
std::cout << "function successfully called";
}
int main()
{
char userInput [128];
std::cin.getline(userInput, 128);
std::cout << userInput;
if (userInput == "pie")
{
std::cout << "values are equal";
functionCall();
}
return 0;
}
now, I'll enter "pie" at the prompt, however it just skips over the IF statement and exits. What am I doing wrong?