feat: Initial commit
This commit is contained in:
21
Lab09/conv.c
Normal file
21
Lab09/conv.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
FILE * fin = fopen("a.txt","r");
|
||||
int fout = open("test",O_CREAT|O_WRONLY);
|
||||
|
||||
float c,x;
|
||||
int n;
|
||||
|
||||
while(fscanf(fin, "%f %f %d\n", &c, &x, &n) == 3) {
|
||||
write(fout,&c,sizeof(float));
|
||||
write(fout,&x,sizeof(float));
|
||||
write(fout,&n,sizeof(int));
|
||||
puts("ed uno");
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
close(fout);
|
||||
}
|
||||
Reference in New Issue
Block a user