摘要: #include #include int main( void ){ FILE *stream; typedef struct _tt{ int a; int b; char buf[20]; }tt;//定义结构体 tt temp; temp.a=10; temp.b=20; strcpy(temp.buf,"hello");//为结构体赋值 int c=sizeof(temp); stream= fopen("at.dat","w+");//打开文件 fwrite(&temp,sizeof(temp),1,stream) 阅读全文
posted @ 2013-11-10 14:03 我心狂野 阅读(1004) 评论(0) 推荐(0) 编辑