R
ranjeet.gupta
Dear All,
I have line of code
fprintf(Fp_write, "%x", *Data++);
Data is char *,
The problem in the above line of code
its says that data is char but you print in the file with binary mode
i.e "%x", this x is unsigned int.... so when we print in the file
we get the extra field as the ffffff as the prefix on most of the
data.
I can understand this problem as I am trying to take the char pointer
value but forcing the compiler to print in the unsigned int format
i.e (%x)... But I dont know how to fix ? as i only want to print
the char data into the binary.
any idea and pointer to this
Thanks In Advance.
Ranjeet
I have line of code
fprintf(Fp_write, "%x", *Data++);
Data is char *,
The problem in the above line of code
its says that data is char but you print in the file with binary mode
i.e "%x", this x is unsigned int.... so when we print in the file
we get the extra field as the ffffff as the prefix on most of the
data.
I can understand this problem as I am trying to take the char pointer
value but forcing the compiler to print in the unsigned int format
i.e (%x)... But I dont know how to fix ? as i only want to print
the char data into the binary.
any idea and pointer to this
Thanks In Advance.
Ranjeet