cin in array in c ++

-1

How can I enter data in an array of ints from the cin?

int leer[5];

cin>>leer;
    
asked by Jon 30.12.2017 в 17:17
source

1 answer

1

If you have an array such that:

int leer[5];

One way to fill it in based on user data could be:

for( int i=0; i<5; i++ )
  std::cin >> leer[i];
    
answered by 02.01.2018 в 08:13