Hi everyone! i just had a second lesson in C++ and i need your help!
I want to make this little thing that asks for the user name and i want that if my friend (shai natapov) will enter his name the program will say "Shai natapov detected!"
Anyway its not working here is what i did:(THANX FOR THE PPL WHO ANSWER :D)
#include <iostream.h>
int main () {
float name;
cout << "Hi there, what is your name?\n";
cin >> name;
cin.ignore();
if (name == shai natapov) {
cout << "Shai natapov detected!\n"
Using cin will stop your input once a whitespace is found. A whitespace can be a simple space, or a return character.
Thus if you enter two words, only the first will be read.
Getline solves this problem.