2D array

Hi . How Write program accept 4 input from user for ID and Name and Store in 2D array . and list Array elements in exact manner as in the sample out.

for example

Id = 123 name = ABC
id = 124 name =DEF
Last edited on
You don't need a 2D array to do this. What you need is to define a structure that holds an int (for id) and a string (for name) and then declare an array of 2 such structures.

Info on structures -> http://cplusplus.com/doc/tutorial/structures/
Info on arrays -> http://cplusplus.com/doc/tutorial/arrays/
Info on string -> http://cplusplus.com/reference/string/string/
Topic archived. No new replies allowed.