Storing user input

I understand the concept to make a code to ask a user to input variables, but how would i go about taking the information the user inputs and storing it all in one so that it can be used later in my code? Example:

output: How many day do you work per week?
input from user : 5
output: how many hours?
input from user: 8
output: how long is your lunch break(hours)?
input : 0.5
** i get up to this part **

The code would then store that information all together and be able to be used in a matrix calculation later in the code.
Last edited on
Vector, array, or list. Take your pick. Or if you wanna be fancy schmancy and know how file I/O works, external text files.

http://www.cplusplus.com/reference/vector/vector/?kw=vector
http://www.cplusplus.com/reference/array/array/?kw=array
http://www.cplusplus.com/reference/list/list/?kw=list
http://www.cplusplus.com/doc/tutorial/files/

Note that out of the four, file I/O and linked lists are likely to be the most difficult conceptually (personal opinion). Btw a 2d array is going to make up your matrix,

ex. int arrayThing [][] // <-- two sets of brackets means array of arrays
Topic archived. No new replies allowed.