how do i display the contents of an array. i got the following code i made, just doesnt display. Says segmentation fault:
there is something wrong with this bit but am not sure:Code:int main(int argc, char * argv[]) { // Mainline Variable Declarations FILE * output = stdout; FILE * input = stdin; int i; float array[10]; for(i=1; i<=10; i++) { fprintf(output,"Please enter value %i: ",i); fscanf(input,"%f",&array[i]); } for(i=1; i<=10; i++) { fprintf(output,"%f ",array[i]); } }
Code:for(i=1; i<=10; i++) { fprintf(output,"%f ",array[i]); }



LinkBack URL
About LinkBacks


