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

    Arrays of GvNode pointers

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 152 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 20/08/2006 at 12:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.521 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi Guys,
      This is more of a C++ related question, than that of a Cinema SDK question. But, I need to create an array of GvNode pointers. So my code is the following:
      const LONG arraySize = 1000;
      GvNode *pNode[arraySize] = NULL;
       
      Now when ever I go to compile this I get the following error:
      'cannot convert from 'int' to 'GvNode *[1000]'
      I would think that this would create an array of 1000 GvNode *pNode. But obviously this isn't the case. Anyone have any ideas how to make this array of pointers work?
      PS; I have checked all my C++ programming books to make sure that my syntax for creating arrays of pointers is correct, which it is os I am a little confused on why the compiler is flagging this error. As always thanks for any help.
      Josh

      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 20/08/2006 at 15:29, xxxxxxxx wrote:

        I don't think that it is legal to set an array to NULL (?). You could always try:

        GvNode* pNode[arraySize] = static_cast<GvNode*[arraySize]>(NULL);

        Personally, that's just too much obfuscation even if it works. This is the better approach:

        const LONG arraySize = 1000;
        GvNode* pNode[arraySize];
        //** this **
        for (LONG e = 0; e < arraySize; ++e) pNode[e] = NULL;
        //** or this **
        ClearMem(&pNode;[0], sizeof(GvNode* )*arraySize);

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