jeudi 8 mars 2018

C scope visibility

if(strcmp(t,"LOADMAP")==0){
        char loadmap[20];

        sscanf(test1,"%s %d %d ",&loadmap,&i,&j);




        char **mat = (char**) calloc(i, sizeof(char*));

        for ( u = 0; u < i; u++ )
        {
         mat[u] = (char*) calloc(k, sizeof(char));
        }

I define a dynamic array like this but it is not visible to other if statements.What can I do to fix this?

Aucun commentaire:

Enregistrer un commentaire