Cout and cin help please.

Hi. So this is only part of the code but I would like to know why the code won't allow the user to enter their height . Any help would be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main()

{

    int name1;
    int name2;
    int name3;
    int name4;
    int name5;

    int height1;
    int height2;
    int height3;
    int height4;
    int height5;

    cout << "What's your name?";
    cin >> name1;
  

    cout << "What's your height?";
    cin >> height1;



    return 0;
}

Last edited on
Declare name1 through name5, as strings, not int's.
Thank you ever so much!
Topic archived. No new replies allowed.