Scusate, mi sono sbagliato a inserire il codice..
Ecco il codice completo:
Codice PHP:
#include <stdio.h>
#include <stdlib.h>
#define M 20

int caricaSpirale(int mat[][M]);
void stampaMatrice(int mat[][M], int dim);

int main()
{
    
int dim;
    
int mat[M][M];
    
    
dim=caricaSpirale(mat);
    if (
dim==-1)
    {
        
printf("Errore\n");
        
system("PAUSE");
        exit(
1);
    }
    else
    {
        
stampaMatrice(mat,dim);

        
printf("\n");
        
system("PAUSE");
    }
}

int caricaSpirale(int mat[][M])
{
    
FILEf;
    
int dim,est,dimOLD,j,i,temp;
    
char nomeFile[M];
    
printf("\nInserisci nome file:\t");
    
scanf("%s"nomeFile);
    
f=fopen(nomeFile,"r");
    
    if (
f==NULL)
    {
        
fclose(f);
        return -
1;
    }
    else
    {
    
fscanf(f,"%d",&dimOLD);
    
dim=dimOLD-1;
    
    for (
i=0i<dimi++)
        for (
j=0j<dimj++)
            
mat[i][j]=0;
    
printf("OK");
    
    
    for (
est=0est<=dim/2est++)
    {
        for (
j=estj<=dim-estj++)
        {
            
fscanf(f"%d"temp);
            
mat[est][j]=temp;
//            printf("%d %d\n", est, j);
        
}
        for (
i=est+1i<=dim-esti++)
        {
            
fscanf(f"%d"temp);
            
mat[i][dim-est]=temp;
//            printf("%d %d\n", i, dim-est);
        
}
        for (
j=dim-est-1j>=estj--)
        {
            
fscanf(f"%d"temp);
            
mat[dim-est][j]=temp;
//            printf("%d %d\n", dim-est, j);
        
}
        for (
i=dim-est-1i>=est+1i--)
        {
            
fscanf(f"%d"temp);
            
mat[i][est]=temp;
//            printf("%d %d\n", i, est);
        
}
    }
    
fclose(f);
    return 
dim;
    }
}

void stampaMatrice(int mat[][M], int dim)
{
    
int i,j;
    
    
printf("\n");
    for (
i=0i<dimi++)
    {
        for (
j=0j<dimj++)
            
printf("%d\t"mat[i][j]);
        
printf("\n");
    }

Grazie degli aiuti..