473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to print multi dimension array in matrix

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
3 1292
Question is not very clear.
Sep 29 '15 #2
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
9,208 Expert Mod 8TB
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

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

Similar topics

6
by: Adam Hartshorne | last post by:
The input to a function of a 3rd party library I want to use requires a double**, which is a multi-dimension array of doubles. I have looked on the net etc and seen several ways of supposedly...
3
by: Makiyo | last post by:
how do u do something like this char x; x = "hello"; I got an error, but is there a way I can do it without using pointer? thx ; )
3
by: Eric Laberge | last post by:
Aloha! I've been reading the standard (May '05 draft, actually) and stumbled across this: 6.7.1 Initialization §20 "If the aggregate or union contains elements or members that are aggregates...
11
by: natkw1 | last post by:
Hi, I'm new to C so hopefully someone can give me some guidance on where I've gone wrong. I've written the following code, trying to initialize the multi-dim array but it's not working: ...
12
by: natkw1 | last post by:
Hi, I'm attempting to understand the use of pointers(at least grasp how pointers work). I've read the FAQ on http://www.eskimo.com/~scs/C-faq/s6.html on pointers and arrays but I'm still a bit...
0
by: Hai Ly Hoang | last post by:
Hi, I'm using VC++ 7.0 (VS 2003). My code: void main() { int *a = new int; } I'm sure that the above code is accepted by VC++ (no compiling error). What is exactly the semantic of the above...
2
by: pob | last post by:
I was all happy because thru some tutelage of others I created this array to find the newest file in a directory. However, I then realized its great that I now know the latest file, but I need to...
7
by: lovecreatesbea... | last post by:
Is it always legal to cast expressions of type of multi-dimension array to type of pointer? Including: T to T* , T to T* , T to T* , and so on... For example: int *mtxrot1d(int *p,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.