0

how to catch a name

HI , plaese help me, I want to catch user name by himselve but when I use 'int', it doesn't work, and it doesn't show user name, my code is what you see 👇 #include <iostream> using namespace std; int main() { int a; cout<<"enter your name"; cin>>a; cout<<a; cout<<"is a beautiful name"; return 0; } please help me how to fix this

19th Jul 2016, 1:06 AM
Reza Sarvani
Reza Sarvani - avatar
3 ответов
+ 1
you should using type data string..
19th Jul 2016, 2:48 AM
Rizky lexsi
+ 1
because type data int (integer) only for a whole number.. and string to a words..
19th Jul 2016, 2:49 AM
Rizky lexsi
0
thanks to all
19th Jul 2016, 3:58 AM
Reza Sarvani
Reza Sarvani - avatar