Initial commit
This commit is contained in:
16
kapitel12/lasa-bin-ex1.c
Normal file
16
kapitel12/lasa-bin-ex1.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
FILE *binfil;
|
||||
float x;
|
||||
if ( (binfil = fopen("flyttal.bin", "rb")) == 0 )
|
||||
{
|
||||
fprintf(stderr, "Kunde inte öppna filen\n");
|
||||
return 1;
|
||||
}
|
||||
fread(&x, sizeof(x), 1, binfil);
|
||||
printf("Flyttalet är: %f\n", x);
|
||||
fclose(binfil);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user