passing the array... please help.. c++ syntax.. 2 dimensional array..
@Callisto
@bbkzr31
@e.mccormick
please help guys :)
@ganeshie8
@nincompoop
All arrays are passed by reference.
yes
Well, to get the reference proper for mupltiple dimensions, the size is involved.
no its still a 2 dimensional array
Here, this has some code samples: http://stackoverflow.com/questions/8767166/passing-2d-array-to-function
i already know the 2d
The first dimension, you do not need to pass the size of. All others you need to pass the size of. Does not matter if it is 2 or more. You must pass the size of any dimension past the first. Or you deal in pointers an assortment of other ways.
but the question is how can i pass the col to row
statement should i put there
Ah, so you are changing dimensions. You will have to handle it in the function.
and how can i make a statement in the program to make sure no two number have the same of digits
yes
You will need to make your destination array, then have the friction loop through it is the most straightforward way. Pass it the first element of both. OR If you do not need a copy, just need a pointer, you can set it so the elements of the 2nd point to the elements of the first.
what?? you're too advance. :( explain it step by step please.
i only have less than 30 mins left
In psudocode arry1[r][c] arry2[c][r] for i = 0 to r for j = 0 to c arry2[j][i] = arry1[i][j] next j next i A similar method can be done using pointers.
1 array should be used
for example num[5][2]
Hmmm... not sure if there is a way to easily swap the pointers of the array. If so, that would certainly do it.
hmmm.. :/
Yah, I have swapped the pointers to move rows around or columns around, and there are tons of examples for that. It might be the same thing, but swapping the row and column start pointers.
uhh
swapping to col to col and arranging it from least to greatest
do you have??
You can do that with a sort and swapping the pointers of the columns. The entore column is changed when you swap pointers.
how to input values to first coloum only??
how to pass the values to second value??
what statement should i put on the program??
huhuhu please help :/
Looking for a reference...
Some of it is covered here. later posts have code samples: http://www.physicsforums.com/showthread.php?t=309053
:/
its extended by 4 hours..
i'll get back on it..
heheh
thank you @e.mccormick
Shows the row-col swap.
@wolfe8 please help :)
@Kainui please help :)
@Preetha
@timo86m
@Rina.r
Join our real-time social learning platform and learn together with your friends!