#include<iostream>
#include<cstdio>
using?namespace?std;
int?main()
{
?FILE?*p?=?fopen("a.txt",?"w");
?if?(p?==?NULL){
??cout?<<?"no"?<<?endl;
??exit(0);
?}
?char?*s?=?"woasdfsdf";
?while?(s!=NULL){??//這里不對,改成*s!='\0'才對,為什么原來的錯了?
??fputc(*s,?p);
??s++;
?}
?fclose(p);
}
字符串問題,錯誤原因?
慕粉18341035298
2017-01-10 17:12:35