Re: conversion into hexadecimal values
- From: Tor Rustad <tor_rustad@xxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 17:23:10 +0200
sweeet_addiction16@xxxxxxxxx wrote:
hello
im programming in c.i have to write about 100 hexadecimal values in to
a file. how do i do it?pls help me
I guess you want to write binary data as a hex string...
void write_hex(FILE *out, unsigned char *binary, size_t binary_len)
{
size_t i;
for (i=0; i<binary_len; i++)
fprintf(out, "%02X", (int)binary[i]);
}
--
Tor <torust [at] online [dot] no>
.
- References:
- conversion into hexadecimal values
- From: sweeet_addiction16
- conversion into hexadecimal values
- Prev by Date: Re: size_t problems
- Next by Date: Re: size_t problems
- Previous by thread: Re: conversion into hexadecimal values
- Next by thread: Comile fails with make: Fatal error: Command failed for target ...
- Index(es):