Ask your own question, for FREE!
Computer Science 12 Online
OpenStudy (anonymous):

Can someone help me revise this code? It isn't compiling. #include "stdafx.h" #include using namespace std; int main() { string yourName; cout<<"Enter your first name:"<>yourName; if (string = "emily") { cout<<"Hello"<

OpenStudy (anonymous):

if (yourName == "Emily") note that there is two equals and you use the word yourName not String but to compare strings you can use : strcmp (yourName , "Emily"); because it compares the content not the pointers. to use it include the string.h header file

OpenStudy (anonymous):

Qustion for you sir. What coding language is this.

OpenStudy (anonymous):

C++

OpenStudy (anonymous):

instead of using strcmp from <cstring>, you may also use string::compare

OpenStudy (anonymous):

Well what's the compilation error? Usually the errors say straight away what the problem is.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!