Please scroll down to my last post!!
I am compiling sucessfully using gcc 3.3 but on running my program seg faults. I have isolated the problem as being to do with an fprintf line which is fine if I replace fptr with stdout, so I think my fopen line is wrong...
here is a summary of every line containing fptr as graciously supplied by grep:
Code:
18- double x, *cumulative;
19: FILE *fptr;
20-
--
31- m = (int) strtol ( argv[2], NULL, 10 );
32: fptr = fopen ( argv[3], "w" );
33: if ( fptr == NULL ) {
34- printf ( "Unable to open \"%s\" to write.\n", argv[3] );
--
155- fprintf ( stdout, "%d\t%d\t%d\n", i+1, j+1, adjacency[i][j] );
156: fprintf ( fptr, "%d\t%d\t%d\n", i+1, j+1, adjacency[i][j] );
157- }
--
161-
162: fclose(fptr);
163- return 0;