To store a multi dimensional matrix in a single array. User will enter the index of the element and it will give the element to the user from the array.
To store a multi dimensional matrix in a single array. User will enter the index of the element and it will give the element to the user from the array.
Multiply each dimension together to get the total number of elements. Allocate one block that size with something like malloc.
Quzah.
Hope is the first step on the road to disappointment.
Can, yes. Will, no. We're not here to do everything for you. Make an effort.
Quzah.
Hope is the first step on the road to disappointment.
I tried many a hundred times.......but something wrong in me.........please give me...........its very important.
It's not important at all to me. Show us your attempt, or look elsewhere.
Quzah.
Hope is the first step on the road to disappointment.
my problem is in runnig the loop......i have allocated the memory space how much it need.........but it giving something wrong in the loop..........so i need some help in running the loop.
Let's try this again.
Show.
Us.
Your.
Attempt.
Quzah.
Hope is the first step on the road to disappointment.
ok i will show u after a little while how i have done.......
Abh, think of a very small and simple example:
Say your array was array[2][2]. So it would look like:
if it had 1,2,3,4 as it's values, and you printed it out by it's rows. Now, if I printed it out all in one line, it would look like: 1 2 3 4. So clearly, it has 2 x 2 or 4 elements in it, and would be just the same as a 1 dimension array with 4 elements: 1 2 3 4.Code:1 2 3 4
That same idea, works with arrays of any size, and any number of dimensions.
Now I can go to bed with a smile. Reading this was a fun!
The keyboard is the standard device used to cause computer errors!