摘要: http://blog.chinaunix.net/u1/37000/showart_338364.html// C语言读写文件.cpp : 定义控制台应用程序的入口点。//#include "stdio.h"#include "string.h"void write(){ FILE *fp; //只写打开或建立一个文本文件,只允许写数据 fp=fopen("D:\\c.txt","wt"); if(fp!=NULL) { char *str="C语言创建txt"; //fputs(str,fp); fwrite(str,strlen(str),1,fp); } //fflush(fp) 阅读全文
posted @ 2010-09-03 18:04 再快一点 阅读(230) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"#include "malloc.h"struct Student{ int id; char *name; };void errorFun(){ struct Student arr[5]; struct Student *parr[5]; for(int i=0;i5;i++) { struct Student stu; stu.id=i; stu.name="wq"; arr[i]=stu; parr[i]=&stu; }}void main(){ errorFun(); } 阅读全文
posted @ 2010-09-03 13:30 再快一点 阅读(182) 评论(0) 推荐(0) 编辑