#include<iostream>
#include<stdio.h>
using namespace std;
FILE *fp;
class tlu
{
public:
float x;
float tlu1(float y)
{
x=y;
}
}one;
int main(int argc, char *argv[])
{
char an[]="change.out";
float y;
cout<<"輸入一個數字:";
cin>>y;
one.tlu1(y);
fp=fopen(an,"wb");
fwrite(one.x,sizeof(float),sizeof(x),fp); /*錯誤的地方*/
fclose(fp);
system("PAUSE");
}
我想請讓人輸入一個float的數字,然後存檔,但是卻無法存檔
請各位大大幫忙解答,謝謝