L
lark2
Unregistered / Unconfirmed
GUEST, unregistred user!
下面的代码写出来为什么是乱码呢?错在哪里?请高手指教
int write(Char * s)
{
FILE *stream;
stream = fopen("log.txt", "a+");
fwrite(s, strlen(s),1, stream);
fclose(stream);
/* close file */
return 0;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char * s;
s="abcdfe";
write(s);
}
int write(Char * s)
{
FILE *stream;
stream = fopen("log.txt", "a+");
fwrite(s, strlen(s),1, stream);
fclose(stream);
/* close file */
return 0;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char * s;
s="abcdfe";
write(s);
}