Oh that’s a bugger. I don’t think the standard C library could do character manip for integers. Maybe some external library could do it. Try writing a procedure yourself.
i’d say make a function to convert the char* to a double (maybe a long double if double isnt big enough for you and you can support it) with double atof( const char string ); then do the math to convert to hex while putting it back into your output char[] (you can google how to convert decimal to hex)
[QUOTE=yaim0310;2354337]i’d say make a function to convert the char* to a double (maybe a long double if double isnt big enough for you and you can support it) with double atof( const char string ); then do the math to convert to hex while putting it back into your output char[] (you can google how to convert decimal to hex)[/QUOTE]
For the example passionpatel gave, double would be insufficiently small to hold a value that big. There needs to be character manipulation for arbitrarily large values.
I remember I wrote a large number factorial calculator based on character manipulation. It’s similar.
It might be helpful to look at how some high-level languages do it. For example, just quickly glancing through the Python source, it looks like [font=monospace] _PyInt_Format[/font] does the work in intobject.c (follow the link to the file, then search for that method).