Reputation: 11
This is my code. This does not produce any output and does not even error. Can anyone please explain why?
#include <stdio.h>
int main() {
FILE *ptr = NULL;
ptr = fopen("numbers.txt", "r");
int i;
int numberArray[6];
for (i = 0; i <5; i++) {
fprintf(ptr, "%d ", numberArray[i]);
}
fclose(ptr);
}
Upvotes: 0
Views: 72