/ Forside / Teknologi / Udvikling / C/C++ / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
C/C++
#NavnPoint
BertelBra.. 2425
pmbruun 695
Master_of.. 501
Bech_bb 500
kyllekylle 500
jdjespers.. 500
gibson 300
scootergr.. 300
molokyle 287
10  strarup 270
How to convert unsigned char to char?
Fra : Hayati


Dato : 30-01-06 14:43

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: 040860@hig.no

Thank's a lot.



 
 
Thomas Lykkeberg (30-01-2006)
Kommentar
Fra : Thomas Lykkeberg


Dato : 30-01-06 17:17

On Mon, 30 Jan 2006 14:43:26 +0100, "Hayati" <hayati-k@online.no>
wrote:

>printf("%02x",(unsigned char)hash[i]);
>
>How can I "catch" the output into a string?

By using sprintf instead of printf

Br
/Thomas

Søg
Reklame
Statistik
Spørgsmål : 177428
Tips : 31962
Nyheder : 719565
Indlæg : 6407943
Brugere : 218877

Månedens bedste
Årets bedste
Sidste års bedste