easy variable question

This is a discussion on easy variable question within the C Programming forums, part of the General Programming Boards category; is it jsut string that are terminated by

Thread: easy variable question

or are there any other types that use this?...

  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,796
    >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, 03:59 PM
  2. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 05:23 AM
  3. Easy String position question...
    By Striph in forum C Programming
    Replies: 4
    Last Post: 05-11-2009, 09:48 PM
  4. Replies: 9
    Last Post: 06-09-2008, 10:53 AM
  5. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM

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