- Subject: [slang-users] Data type
- From: Laurent Perez <Laurent.Perez@xxxxxxxxxxxxxxxxx>
- Date: Mon, 4 Apr 2005 15:48:18 +0200
Hello,
I don't understand well how datas are converted from one type to another.
For example :
i = 65;
fwrite (i, fp);
The resulting file is :
0x00000000: 41000000 A...
i = 65Uh ;
fwrite (i, fp);
The resulting file is :
0x00000000: 4100 A.
i = 65;
typecast (i, UChar_Type);
fwrite (i, fp);
The resulting file is :
0x00000000: 41000000 A...
i = 65;
fwrite (pack("C",i), fp);
The resulting file is :
0x00000000: 41 A
This is probably a stupid question but could anybody please explain me
the "typecast ()" behavior ? Thanks.
Regards ;
Laurent.
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2005 date index]
[2005 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]