I'm taking a c++ beginner's distance class and can't solve this compile error. It's written exactly as in the example book, and when my brother cuts and pastes it into his VS2015 it works fine, but in my VS2017 it doesn't. I have uninstalled and re-installed VS2017 community to no avail.
I have only been coding for 2 weeks so I'm very, very new to this.
The error codes I get are:
Error E0167 argument of type "const char " is incompatible with parameter of type "char
Error C2664 'void Hello(char )': cannot convert argument 1 from 'const char [8]' to 'char '
The code:
// FUNCTION: Hello, prints out a welcome message on the screen.
void Hello(char* name)
{
cout << "Hello " << name << "!";
}
// FUNCTION: Main, program start.
int main()
{
Hello("Krister");
cin.get();
return 0;
}
I really hope someone can help me with this.
All the best, Jepp