Thread: easy variable question

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    28

    easy variable question

    is it jsut string that are terminated by \0 or are there any other types that use this?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: easy variable question

    Originally posted by Gav D
    is it jsut string that are terminated by \0 or are there any other types that use this?
    Only strings. You can have the value of NULL stored in something else, like say a single character, but the main thing it's ever used for is terminating strings.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >ou can have the value of NULL stored in something else, like say a single character, but the main thing it's ever used for is terminating strings.
    Careful quzah, NULL and '\0' are not the same creature. I've seen quite a few programs assume that they are and end up going splat because of it.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Easy mmap question
    By randomyzed in forum C Programming
    Replies: 1
    Last Post: 06-03-2009, 02:59 PM
  2. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  3. Easy String position question...
    By Striph in forum C Programming
    Replies: 4
    Last Post: 05-11-2009, 08:48 PM
  4. Replies: 9
    Last Post: 06-09-2008, 09:53 AM
  5. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM