#include<string.h>
void main()
{ char str[256]//也可以写轮此char str[256]={"中文字符串\n"}那么就可以省略后面strcpy一句了
FILE *fp
if ( fp=fopen("data.txt"带槐,"w+") )
{ strcpy(str,"中文字符串蠢桐友\n")
fputs(str,fp)
fclose(fp)
}
}
代薯蚂码胡冲如下:while (p != NULL)
{
sprintf (temp_string1, "0x%s", p)
sscanf (temp_string1, "%x", &temp_int)
printf("temp_string1=%d\n"裤手歼,temp_int)
memset (hanzi_string+i++, (unsigned char) (*((unsigned char *)&temp_int) | *((unsigned char *)&temp_int+1) |*((unsigned char *)
&temp_int+2) | *((unsigned char *)&temp_int+3)), 1)
printf("hanzi_string=%s\n",hanzi_string)
if (p != NULL) p = (char *) strtok (p+strlen (p)+1, " ")
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)