I'm trying to make a joke for my friends, and it says I must declare "Spencer" in the scope, how do i go about doing this?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string name;
cout<<"Please enter your name:";
cin>>name;
if (name == Garrett) {
cout<<"Hey, how ya doing sexy?";
}
elseif (name == Spencer) {
cout<<"Go home.";
}
return 0;
}
The Error Messages:
1 2 3 4
C:\Users\Spencer\Documents\Le Programming\Hello world\main.cpp||In function 'int main()':|
C:\Users\Spencer\Documents\Le Programming\Hello world\main.cpp|10|error: 'Garrett' was not declared in this scope|
C:\Users\Spencer\Documents\Le Programming\Hello world\main.cpp|14|error: 'Spencer' was not declared in this scope|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===|