|
-
December 27th, 2003, 09:01 PM
#1
Get rid of 0x0d!!!
In a image format header , 0x0c0x0a is the keyword.
As i write it in a program , it's result is always WRONG!
0x0a is automatically generate a 0x0d before itself.
For example , write in 0x0c0x0a -> response 0x0c0x0d0x0a
What should i do?!?!?!
Source Code is as follows:
===
int out = open("test.vox",O_RDWR | O_CREAT | O_BINARY,S_IWRITE);
if (out <=0 )
{
printf("file open error \n");
}
else
{
char temp[17]="Vox1999a\x0a##\x0c\x0a##\n";
// ^^^^^^^^
write(out,temp,16);
write(out,"VolumeSize ",11);
itoa(xd2,strtmp,10); //x dim
write(out,strtmp,strlen(strtmp));
write(out," ",1);
itoa(yd2,strtmp,10); //y dim
write(out,strtmp,strlen(strtmp));
write(out," ",1);
itoa(zd2,strtmp,10); //z dim
write(out,strtmp,strlen(strtmp));
write(out,"\n",1);
//...µ¥µ¥µ¥
close(out);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|