I'm sure there is likely a simple solution to this, but my brain has turned to mush working on this code.
if this code will simply display my array....How can I change this to write the array[--i] to a file. I've tried the following code, but get an error message. Could someone please point me in the right direction.Code:while(i > 0) { printf("%d\n", array[--i]); }
Code:while(i > 0) { fptr = fopen("junk3.txt", "w"); fwrite(array[--i], sizeof(array[i]), 1, fptr); fclose(fptr); }