By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

how to print multi dimension array in matrix

P: 1
how to print :
1) 3 2) 1 2 3 3) 1 2 3 4) 1
6 5 4 5 5 6 4 5
7 8 9 7 9 7 8 9
Sep 29 '15 #1
Share this Question
Share on Google+
3 Replies


P: 22
Question is not very clear.
Sep 29 '15 #2

P: 16
you basically print a 2d array in the form of a matrix using two loops.One nested inside another.One loop to control the row and the other to control the column.
Sep 29 '15 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
You might read this: http://bytes.com/topic/c/insights/77...rrays-revealed

Then you would know there really aren't multidimensional arrays in C or C++. (See the last example).

Therefore, the simplest method is to iterate the array the array and display each character as you go. If this array is
[3][4] then just display a \n after each three elements. This requires one loop.
Oct 2 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.