I'm trying to use scanf to store something in a 2D array and print it out, except im not sure how to do this.. can any body help?
for example:
Input:
******
*AAAA*
*AAAA*
******
output:
******
*AAAA*
*AAAA*
******
Thank you
I'm trying to use scanf to store something in a 2D array and print it out, except im not sure how to do this.. can any body help?
for example:
Input:
******
*AAAA*
*AAAA*
******
output:
******
*AAAA*
*AAAA*
******
Thank you
Last edited by Killahkode; 09-27-2006 at 09:26 PM.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Use fgets() rather than scanf() and read in each line individually into the array. If you don't want to deal with null characters, you can use getchar() in a loop incrementing the array index until you're at the end of the array.
Sent from my iPadŽ