I have a small file containing numbers, separated by new lines/spaces. I am looking for a way to scan the file , but in reverse.
Input: 1 2 3 4 5 1025
Output: 1025 5 4 3 2 1
Attention! in the following code, I need to modify the scanf. I need to leave printf unchanged! I don't need to transform 1024 into 4201, the integers remain unchanged. Only their order changes.
Code:
while (fscanf(input,"%d", &b) && !feof(input)) {printf("%d",b);}