plz send me the source code for converting an array in 2Dimension into a 1Dimensional array..i need it for further application in generalising it for N dimensions..
plz help..
plz send me the source code for converting an array in 2Dimension into a 1Dimensional array..i need it for further application in generalising it for N dimensions..
plz help..
We don't do other people's work for them. We'll be happy to help you devise a solution though, if you can provide more information and describe what you've already tried.
My best code is written with the delete key.
a thought for you.... a multi dim array is pretty sequential in memory. You could spend a minute thinking about how they might do that. Then implement it in code.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
>a thought for you.... a multi dim array is pretty sequential in memory.
Pretty sequential, but not necessarily exactly sequential. A multidimensional array is an array of arrays, and each array is independent. So any extra "stuff", transparent to the programmer, that an array has will exist in each subarray of a multidimensional array. This means that treating a multidimensional array as a one dimensional array is inherently non-portable. Be wary of that solution.
My best code is written with the delete key.
yeah, I hadn't thought that he might go that direction (casting it or something). Actually, I was thinking more along the lines of doing the math to get the right index in a single dim. Good catch P.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter