69,382
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char str[] = "123abc";
FILE *fp = fopen("123.txt", "w+");
if (!fp)
{
printf("Open File Error!\n");
exit(-1);
}
/*wrtie into file*/
fwrite(str, strlen(str), 1, fp);
fclose(fp);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE* fp = fopen("out.txt", "w");
if(!fp)
{
printf("error\n");
exit(1);
}
fprintf(fp, "%x\n", 123);
return 0;
}