cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
2D array
2D array
May 14, 2010 at 10:15am UTC
ehsangha
(55)
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
May 14, 2010 at 10:45am UTC
May 14, 2010 at 10:56am UTC
m4ster r0shi
(2201)
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.