Re: How to implement 'atoi' when radix=16 and number string is negati

Tech-Archive recommends: Speed Up your PC by fixing your registry



Use _itoa

--
Regards,
Nish [VC++ MVP]


"Tracey" <Tracey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2D5D3B7E-979C-4EC1-8EFA-D5CB5EB64158@xxxxxxxxxxxxxxxx
> I'm learning C++ and was stuck when writing code to convert a negative
> decimal number string to a hexdecimal number. For example, suppose the
> function interface is defined as:
>
> int atoi( const char*, size_t radix)
>
> One input string is "-1234" and radix is 16.
>
> How to get the correct hexdecimal integer? Can anyone help ? Thanks in
> advance!
>


.



Relevant Pages

  • Re: Why atexit is limited to 32 functions?
    ... When I am truly stuck I will post code or ask standard related questions. ... Sorry, no, I didn't read your "original treatments of MR&C". ... very proficient in Fortran and have been forced into learning C for a ...
    (comp.lang.c)
  • Re: Fret Board Learning Recomendations
    ... It's an exercise to learn the A string: ... you'll know the notes on both the E string and the A string. ... That's why I think learning classical playing from the ... It keeps me from falling asleep ...
    (alt.guitar.beginner)
  • Re: run batch file with Standard Output and Input
    ... input, the process is stuck, and i can't send him the input. ... string line = rd.ReadToEnd; ... ReadToEnd() before you write any input. ... going to be present and which won't block your thread waiting on more ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Data structure in system call/user program
    ... Learning is the production of internal ... What do you do when you get stuck? ... That is a question like "how do I use a baseball". ... YOu will have to first specify your language, ...
    (alt.os.linux)
  • Re: Rank newbie question - Class or Function?
    ... working out the best ways of writing code that needs to run in various ... I have no problem with a shared method. ... State as string, byval ZipCode as string) as String ... All you seemed to do was create confusion. ...
    (microsoft.public.dotnet.languages.vb)