--------------------------------------------------------------------------------
Hi, how can i write a C program in Red Hat 9. I can't find a compiler.
Also would you mind looking at this code and telling me if you think its ok. I need to put a file which has many columns of data (of which i only need the first two) into an array, so that i can add it to another such file. This is prob very basic, but C is a bit of a mystery to me and i'm only beginning to find my way.
What do you reckon? How can i show if this worked, would some simple printf command work? Oh, and to put the final array back into a file? Is that just fprintf? Thanks very much for any help you can provide.Code:#include<stdio.h> void main() { int i,j,array1[][2]; FILE *inp; inp=fopen("file1.txt","r"); for(i=0;i!=EOF;i++) for(j=0;j<2;j++) { fscanf(inp,"%d",&array1[i][j]); } fclose(inp); }