Hi all, I am a newbie of C
im doing my exercise about showing the edge like this
0 0 0 0 0 0 0
0 0 1 1 1 0 0
0 1 0 0 0 1 0
0 0 1 1 1 0 0
0 0 0 0 0 0 0
, and i got stuck w/ it. my code is:
insert
Code:
#include <stdio.h>
#include <stdlib.h>
void print ( int A[5][7] );
main ()
{
int A[5][7] = { { 0, 0, 0, 0, 0, 0, 0 } ,
{ 0, 0, 1, 1, 1, 0, 0 } ,
{ 0, 1, 0, 0, 0, 1, 0},
{ 0, 0, 1, 1, 1, 0 ,0 } ,
{ 0, 0, 0, 0, 0, 0, 0 } };
printf ("\nShowing the edge: \n");
print(A);
return EXIT_SUCCESS;
}
void print (int A[5][7])
{
int x, y;
for (x = 0; x < 5; x++){
for (y = 0; y < 7; y++)
A[x][y]= 0 ;
putchar ('\n');
}
}
could u guys put some comments about it? Did I miss some commands or sth like that??? Please help me