Pass simple array to two dimensional array
in
Programming Questions
•
1 year ago
I have an simple array. Now I want to pass this array over to a two dimensional array.
Is there a way to do this without a loop? Or with pointers, so I don't need extra space?
- char pic[] = {
- 11,7,
- 0xC0,0x00,
- 0x67,0x00,
- 0x26,0x80,
- 0x5F,0x60,
- 0x26,0x80,
- 0x67,0x00,
- 0xC0,0x00};
- char[][] images;
- images = new char[1][pic.length];
- for(int i = 0; i < pic.length; i++){
- images[0][i]=pic[i];
- }
Is there a way to do this without a loop? Or with pointers, so I don't need extra space?
1