Advertisement
paulogp

cin

Aug 8th, 2011
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. // apple xcode
  2. // paulogp
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main (int argc, const char * argv[])
  8. {
  9.     char the_first_name[256] = {};
  10.     char the_last_name[256] = {};
  11.     int the_age = 0;
  12.    
  13.     cout << "first name: ";
  14.     cin.getline (the_first_name, 256);
  15.    
  16.     cout << "last name: ";
  17.     cin.getline (the_last_name, 256);
  18.    
  19.     cout << "age: ";
  20.     cin >> the_age;
  21.    
  22.     cout << "your name is " << the_first_name << " "
  23.     << the_last_name << " and your age is " << the_age << endl;
  24.    
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement