Ascii

This is a discussion on Ascii within the C++ Programming forums, part of the General Programming Boards category; What do the integer 0 correspond to in ascii and unicode? Can i use the integer 0 to "terminate" my ...

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    Ascii

    What do the integer 0 correspond to in ascii and unicode?

    Can i use the integer 0 to "terminate" my char[] inputbuffers?

  2. #2
    former member Brain Cell's Avatar
    Join Date
    Feb 2004
    Posts
    472
    ASCII table

    not sure about your second question though.
    My Tutorials :
    - Bad programming practices in : C
    - C\C++ Tips
    (constrcutive criticism is very welcome)


    - Brain Cell

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    you can terminate with '0' when you write your own functions who do the right thing then.
    some functions accept a delimiter symbol (i think it was read and write (stream io)) .
    basically it depends on how a function "interprets" a symbol. if it interprets it the way you expect it to interpret then its ok. problem arise when there are differences between what the function does and what you excpect it to do

    note that you dont need to terminate arrays.
    but all string functions of the c library expect strings to be terminated by a '\0' character.
    signature under construction

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    0 is an int. '0' is the char zero (or maybe the char capital Oh, I can seldom tell the difference). '\0' is the char representation of the null char. Therefore 0 and '\0' can be used interchangeably.
    You're only born perfect.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ASCII character with ASCII value 0 and 32
    By hitesh_best in forum C Programming
    Replies: 4
    Last Post: 07-24-2007, 09:45 AM
  2. Replies: 11
    Last Post: 03-24-2006, 10:26 AM
  3. Office access in C/C++ NOT VC++!! :)
    By skawky in forum C++ Programming
    Replies: 1
    Last Post: 05-26-2005, 01:43 PM
  4. ascii values for keys
    By acid45 in forum C Programming
    Replies: 2
    Last Post: 05-12-2003, 07:13 AM
  5. Checking ascii values of char input
    By yank in forum C Programming
    Replies: 2
    Last Post: 04-29-2003, 07:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21