C语言,字符串转成16进制或者二进制写入二进制文件

2025-01-08 08:52:09
推荐回答(1个)
回答1:

char szV[]="205";
char* stop;
FILE fp
if((fp = fopen("fille name","wb")) != NULL)
{
unsigned long v = strtod(szV,&stop);
fwrite(&v,sizeof(unsigned long),1,fp);
fclose(fp);
}