Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Coffee: NULL == 0?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 231 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 22/10/2007 at 07:06, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.5 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      I want to check if specific fields in a three-dimensional array are already set (the third dimension has only two fields). Although the term

      if(edges[minPoint][maxPoint][0] == NULL)
            edges[minPoint][maxPoint][0] = value;
      else
            edges[minPoint][maxPoint][1] = value;

      seems to be valid, COFFEE treats 0 like NULL. Thus, if the field is filled with 0, the value gets overwritten.

      How can i distinguish between 0 (zero) and NULL (emtpy field)?

      Regards
      Christoph Lauterbach

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 22/10/2007 at 10:27, xxxxxxxx wrote:

        COFFEE doesn't have pointers being typeless. NULL is usually 0 - historically it represents an invalid memory address 0x00000000F assigned to pointers (Assem/C/C++/Java/...). Go to this link for more info:

        http://en.wikipedia.org/wiki/Null\_(computer)

        There is no way to distinguish between 0 and NULL. All variable settings boil to numbers anyway - including pointers.

        Do elements in edges[][][] represent pointers to something or the actual something itself?

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 23/10/2007 at 01:11, xxxxxxxx wrote:

          Thank you Robert. As far as I know, NULL is usually not 0 - while 0 is a value, NULL indicates a non-value.

          Anyway, I solved it with

          if(typeof(edges[minPoint][maxPoint][0]) == DT_NIL)
          [...]

          The elements in edges[][][] represent point indices (thus integers).

          Regards
          Christoph

          1 Reply Last reply Reply Quote 0
          • First post
            Last post