This is "old-style" C function declaration. It is allowed (but deprecated) in C and not allowed in C++.
Also, the type of size is missing: this was only allowed in C89 (which defaulted to int), and is forbidden in C since C99.
You mean all three arguments are int's?
How will the scope be defined?
Last edited on
You are Missing the type of Argument for your function.
Either your function should be
int ReadFile(FILE* file,int size, int * graph)
or
FILE* file;
int* graph;
{
int i, j;
fscanf(file, "%d", &size);
graph = (int*) malloc( size * size * sizeof(int));
for (i = 0; i < size; i++)
for (j = 0; j < size; j++)
fscanf(file, "%d", &(graph)[i*size+j]);
fclose(file);
return(1);
}
int ReadFile(file, int size, graph)
@Rockyy: Did you read @Cubbi's post?