jeudi 2 avril 2015

initialise an array with user input

I am using Visual Studio 2013, c++, console application. I have been struggling with a question for quite some time now. I want to know if there is a way to initialise an array, with input from the user, for example:


I have an array: int arr[] = { 3, 7, 5, 9, 1};. Therefore, I want the initialised values to be a user input.


Is there a way I can do it? All help and comments will be appreciated.


Aucun commentaire:

Enregistrer un commentaire