Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to convert unsigned char to char?

157 views
Skip to first unread message

Hayati

unread,
Jan 30, 2006, 8:43:49 AM1/30/06
to
Hei,

This statement prints what I need. But I need the ouput forwriting to a
file.

printf("%02x",(unsigned char)hash[i]);

How can I "catch" the output into a string?

Please send a copy of your answare to: 040...@hig.no

Thank's a lot.


Jostein Tveit

unread,
Jan 30, 2006, 3:23:19 PM1/30/06
to
"Hayati" <haya...@online.no> writes:

> This statement prints what I need. But I need the ouput forwriting to a
> file.
>
> printf("%02x",(unsigned char)hash[i]);
>
> How can I "catch" the output into a string?

Take a look at fprintf and snprintf.

--
Jostein Tveit <jost...@pvv.ntnu.no>

0 new messages