常用代码
EncodedStar
爱分享,爱学习,爱助人为乐
点个关注再走吧,感谢!
展开
-
【常用】C/C++文件读写(读取加写)
# include < stdio.h > int a; char b,c[100]; int main(){ FILE * fp1 = fopen(“input.txt”, “r”);//打开输入文件 FILE * fp2 = fopen(“output.txt”, “w”);//打开输出文件 if (fp1==NULL || fp2==NULL)...原创 2018-02-23 16:56:34 · 1791 阅读 · 0 评论 -
【常用】文件中的字符一个一个流出来
string getFileContext(const string& filename) { string str; str.clear(); char buf[1024]; char *p; p = buf; memset(buf, 0, 1024); ifstream in; in.open(file...原创 2018-02-23 19:00:43 · 211 阅读 · 0 评论