Hey everyone! I want to create a program. That program it must read a name (characters) and if the name is different with the name which I choose it display a message (wrong name). If the name is correct it display another message. Can anyone help me?? This program is in Code:Blocks
I would read the userdata into a string and then search the string for what you are looking for.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//set up variable userdata... the next two lines may or may not work
//you may need to make a char then typecast it to a string
string userdata;
cin.getline (userdata,256);
string name = "name you choose";
if(userdata.find(name,0) != string::npos){
//whatever should happen if found
}
else{
//what should happen if not found
}
Thanks again for helping me. Now I want to convert the *.cpp file into *.exe file. I have installed the Microsoft Visual Express 2010 but I can't compile it in *.exe file.