sw****************@yahoo.com writes:
[...]
Please don't quote signatures (the part of the article following the
"-- " delimiter).
Im sry may be i didnot frame the question properly..i need to accept
an integer value(decimal) and then after converting it into
hexadecimal value i need to write it into a file.i do not need to
print it..so using fprintf along with %lx would not help me.for eg..if
i have a decimal value of 60 to be passed to a function ..i need that
function to convert it into hexadecimal value(eg 3c) and then write it
into a file
When you say you want to write the hexadecimal value 3c to a file, do
you mean that you want the file to contain the characters '3' and 'c',
or do you want the actual raw non-textual value written to a file?
The latter is referred to as "binary", not hexadecimal. The term
hexadecimal refers only to a textual representation that uses the
digits '0'..'9' and the letters 'a'..'f' (or 'A'..'F'). (Binary data
is often displayed in hexadecimal, which leads some people to think
that it *is* hexadecimal, but it isn't; the process of displaying it
requires a conversion from one form to another.)
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"