C
ph
gets없이 공백 포함한 문자열 scanf
scanf ("%[^\n]%*c", pt);
설명이 너~무 좋아서 그냥 모두 복사해옴. 출처 The [] is the scanset character. [^\n] tells that while the input is not a newline ('\n') take input. Then with the %*c it reads the newline character from the input buffer (which is not read), and the * indicates that this read in input is discarded (assignment suppression), as you do not need it, and this newline in the buffer does not create any problem for next inputs that you might take.
Read/write float binary
How to read a float from binary file in C? / answer
void writefloat(float v, FILE *f) { fwrite((void*)(&v), sizeof(v), 1, f); } float readfloat(FILE *f) { float v; fread((void*)(&v), sizeof(v), 1, f); return v; }