2D arrays and storing characters
I want to read in a file of characters and store each character inside a 2D array. The array will be 8x8 and the file will always contain the same dimensions of characters. I want to treat the array as a 1D array, access the memory allocated for it at array and start filling it all the way up to
array. I don't want to use two for loops, with subscripting like , just look it as an array from 0-63, array would be the last element....but only in memory, in reality it would still be a 2D array. How can I access the beginning of the array all the way to the end element by element? Will using array, array etc.. just give me the entire row? Any help would be appreciated.
int arr* = &actual_array; //pointer to the beginning or the array
int j = 0;
while( (ch = fgetc( theFile )) != feof( input ) )
if( j < (8*8) )
arr[ j++ ] = ch; //is this right? can I advance the pointer like this?