I get a small error when trying to compile this program... its suppost to do password and user checking for a larger program I'm writing... Any help would be appreciated. (Dang thats what I get for not doing C++ for over a year)
The compiler is VC++ 6.0 Pro SP 5
void main()
{
char Hello;
cout << "Hello World!/n";
cout << "Please say Hello/n";
cin >> Hello;
Hello = toupper(Hello);
while(Hello != "HELLO");
{
cout << "That is not Hello./n";
cout << "Please Try Again./n";
cin >> Hello;
Hello = toupper(Hello);
}
cout << "Thank You";
}
Error Message:
Compiling...
File 1.cpp
C:\Programming Projects\C & C++\Project 1\File 1.cpp(12) : error C2446: '!=' : no conversion from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Programming Projects\C & C++\Project 1\File 1.cpp(12) : error C2040: '!=' : 'int' differs in levels of indirection from 'char [6]'
Error executing cl.exe.
File 1.exe - 2 error(s), 0 warning(s)
The compiler is VC++ 6.0 Pro SP 5
void main()
{
char Hello;
cout << "Hello World!/n";
cout << "Please say Hello/n";
cin >> Hello;
Hello = toupper(Hello);
while(Hello != "HELLO");
{
cout << "That is not Hello./n";
cout << "Please Try Again./n";
cin >> Hello;
Hello = toupper(Hello);
}
cout << "Thank You";
}
Error Message:
Compiling...
File 1.cpp
C:\Programming Projects\C & C++\Project 1\File 1.cpp(12) : error C2446: '!=' : no conversion from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Programming Projects\C & C++\Project 1\File 1.cpp(12) : error C2040: '!=' : 'int' differs in levels of indirection from 'char [6]'
Error executing cl.exe.
File 1.exe - 2 error(s), 0 warning(s)