1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

error message

Discussion in 'C' started by panayiotispatra, Nov 11, 2007.

  1. panayiotispatra

    panayiotispatra New Member

    Joined:
    Oct 25, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    I take the following message of error. How I can correct him?

    error: `array' undeclared (first use in this function)
    error: (Each undeclared identifier is reported only once
    error: for each function it appears in.)

    Code:
    void display(int b[9][9])
    {
    	        int i,j;
    
                for(i = 0; i <9; i++)
    				{
    				if(i%3==0)printf("+---------+---------+---------+\n");
    				printf("%d",i+1);
    				for(j = 0; j <9; j++)
    					{
    					if(j%3==0)
    		             printf("| ");
    					printf("%d ", array[i][j]);
    					}
    
    					printf("\n");
    				}
    					printf("\n");
    
    				if(i%3==0) printf("+---------+---------+---------+\n");
    
    }
     
    Last edited by a moderator: Nov 12, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    You have not declared the variable array which you have used in printf("%d ", array[j]);
     

Share This Page