Re: conversion into hexadecimal values



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>
.