Write a program to read a set of integers from a file, sort them and output them into another file.
Answers
Answered by
3
Answer:
- open a file: FILE* inFile = fopen("input.txt", "r").
- read a single value from the input. int numConverted = fscanf(inFile, "%d", &value).
- allocate some memory: int *pInts = malloc(n * sizeof(int)).
- sort the array.
- fprintf(outFile, "%d\n", i).
- write a single value out as binary.
Answered by
5
hy
your answer is here !
open a file: FILE* inFile = fopen("input.txt", "r").
read a single value from the input. int
numConverted = fscanf(inFile, "%d", &value).
allocate some memory: int *pInts = malloc(n * sizeof(int)).
sort the array.
fprintf(outFile, "%d\n", i).
write a single value out as binary.
.
Similar questions
Social Sciences,
4 months ago
Economy,
4 months ago
Math,
9 months ago
Social Sciences,
9 months ago
Math,
1 year ago