Re: Convert Ascii to char



meendar wrote:

I am having a character pointer which contains ascii values.

That's unlikely. `char*` variables contain pointer values,
not ascii character values. The characters the pointer points
to may, or may not, be encoded in ascii.

i just
want to convert all these ascii values to respective characters and
again store it in another character pointer.

I /think/ you mean you want to copy a string from one place
to another.

If the expression `source` has value pointer to string of length N,
and the expression `dest` has value pointer to an array of chars
of length at least N+1, then executing the expression:

strcpy( dest, source )

will copy the string from `source` to `dest`. To use this expression,
you should ensure you've #included <string.h>.

This code doesn't care about ascii. In the unlikely event that matters,
you'll have to explain your problem more centrally.

Note that it's your responsibility to ensure that `dest` points to
enough characters. If it doesn't, your program will be broken, even
if nothing bad /seems/ to happen.

--
Third Floor And Still OK! Hedgehog
"Who do you serve, and who do you trust?" /Crusade/

.



Relevant Pages

  • Re: Reading Files and ASCII Code
    ... As for the ASCII table, are you saying I should just phystically write every ... there a function that allows me to say: "read in x characters from where ... What about moving the pointer in the file ... This is a sample sentence. ...
    (microsoft.public.vc.language)
  • Re: Reading Files and ASCII Code
    ... I understand correctly, it requires a char pointer, an integer value of the ... number of characters to input, and the character to stop at. ... As for the ASCII table, are you saying I should just phystically write ...
    (microsoft.public.vc.language)
  • Re: Reading Files and ASCII Code
    ... type char to work. ... what exactly am I going to use to select very specific numbers of characters ... As for the ASCII table, are you saying I should just phystically write ... pointer is now in the file"? ...
    (microsoft.public.vc.language)
  • Re: Convert Ascii to char
    ... I am having a file with ascii values, ... The characters the pointer points ... and the expression `dest` has value pointer to an array of chars ...
    (comp.lang.c)
  • Re: Reading Files and ASCII Code
    ... If you use MFC you can use CStdioFile and just use ReadStringto read as ... are control characters (some are unreadable, ... As for the ASCII table, are you saying I should just phystically write ... What about moving the pointer in the file ...
    (microsoft.public.vc.language)