Thread: how to interprete this signature..

  1. #31
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    so when it null
    we cant access the sub variables

  2. #32
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,334
    Quote Originally Posted by transgalactic2 View Post
    but its of a complex type
    No. NO. And No. Root is NOT of a complex type. It is a pointer, which is a simple type. ALL it stores is an address. It does not have sub-fields, or anything like that.

    Try using root.lc in your code somewhere. Notice how it doesn't work? That's because root is not a struct node. It is a pointer.

  3. #33
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,653
    Quote Originally Posted by transgalactic2 View Post
    so when it null
    we cant access the sub variables
    You cannot access any valid information or instance of the data because the pointer will not be pointing to a valid instance of the struct.
    Or in other words - it is like having an address to a house in... nowhere. How do you get the information from within the house if you cannot find the house?
    The pointer is the address and it points to the house.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #34
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    thanks i understand this now

  5. #35
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Wow... you made tabstop upset. Kudos to you for that.

    Quote Originally Posted by Elysia
    Updated example. Better now?
    Much. Thanks. Its good to see code that is illiterate blond, friendly.

  6. #36
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    Quote Originally Posted by Elysia View Post
    Simple boolean magic.
    Basic rules:
    0 is false. Always.
    Everything else is true. Always.

    Basic if form:
    if (!tree == true)

    Let us assume that tree contains a value of NULL.
    Thusly, tree is interpreted as false in boolean form (since NULL is one way or another 0).
    Thus, we get:
    if (!false == true)

    The ! operator will invert the meaning of the value it is applied to, so we get:
    if (true == true)

    Or in other words, it's a short-hand for:
    if (tree == NULL)
    so
    false=null
    and when they say
    (!tree) that means tree differs true
    so they ask us if tree equals null

  7. #37
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by transgalactic2 View Post
    so
    false=null
    and when they say
    (!tree) that means tree differs true
    so they ask us if tree equals null
    Correct. (x == NULL) or (!x) is the same thing. It is fairly common to see (!x) rather than (x == NULL), but you will eventually see both at some point during your programming life.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What exactly is a function signature?
    By Sharke in forum C++ Programming
    Replies: 21
    Last Post: 07-01-2009, 11:21 PM
  2. Forum signature banners
    By Akkernight in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 04-04-2009, 03:31 AM
  3. Signature Image - 'Invalid File'
    By Tonto in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-16-2007, 10:32 PM
  4. Limitless signature?
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 12-30-2002, 10:32 PM