Re: convert int to string without using standard library (stdio.h)



ceeques wrote:
Hi

I am a novice in C. Could you guys help me solve this problem -

I need to convert integer(and /short) to string without using sprintf
(I dont have standard libray stdio.h).

for instance:-
int i =2;
char ch 'A'

My result should be a string ==> "A2"

Double check that you don't have sprintf in your system libraries
(even if perhaps you don't have the header for it). Also, look for
'itoa' in your system libraries.

If not, download a public domain implementation of sprintf.

.



Relevant Pages

  • convert int to string without using standard library (stdio.h)
    ... I am a novice in C. Could you guys help me solve this problem - ... I need to convert integerto string without using sprintf ... (I dont have standard libray stdio.h). ...
    (comp.lang.c)
  • Re: How to left pad a string with spaces?
    ... How do I use sprintf to convert the string so it has 4 spaces padded on ... If copying takes place between objects that overlap, ... What would happen if myvar were defined as ...
    (comp.lang.c)
  • Re: How to left pad a string with spaces?
    ... How do I use sprintf to convert the string so it has 4 spaces padded on ... If copying takes place between objects that overlap, ... What would happen if myvar were defined as ...
    (comp.lang.c)
  • Re: sprintf
    ... On the other hand, I'm free to use sprintf(), so I can convert everything I want to print into a string and then forward that string to PrintOnConsole. ... My problem now is that I don't know how many characters sprintf() will put in the buffer provided as first input argument. ... float GimmeAFloat ...
    (comp.lang.c)
  • Re: .exe file inputs
    ... Invalid escape sequence appears in format string. ... you're passing in a path to the executable into the SPRINTF ... name, type it in and hit enter, repeat for a total of 3 file names. ...
    (comp.soft-sys.matlab)