>it has to print the grid like this and im havin trouble with the formatting
Do you need to print the grid as well as the array contents? If so, it takes a smidge more work.
for ( i = 0; i < limit; i++ ) {
/* Print a grid line */
for ( j = 0; j < limit; j++ )
printf ( "+---" );
printf ( "+\n|" );
/* Print the row */
for ( j = 0; j < limit; j++ )
printf ( "'%c'|", grid[i][j] );
putchar ( '\n' );
}
/* Print the last grid line */
for ( j = 0; j < limit; j++ )
printf ( "+---" );
printf ( "+\n|" );
>Buffer size is too much , reduce it
That's a rather useless comment. Elaborate, or don't bother posting.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004