CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 24

Threaded View

  1. #4
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Call Array Member in function Help

    Quote Originally Posted by M2W View Post
    Anyway, I have changed my definition to match the declaration like you suggested. Mainly:

    Code:
    void function_one(Nodes Block) {
      Block[].number = 1;
    However, now it gives me an error telling me that Block[].number = 1 is expecting an argument (inside [] I suppose).
    Yes, of course. As I wrote in my previous post:

    Quote Originally Posted by Eri523
    [...] you would have to access its sole member as Block.number inside the function.
    An empty [] only makes sense in a declaration. (Well, there actually are other contexts where this construct is used as well, but I think I'll ignore them here for simplicity.)

    And I hope the missing curly brace at the end of the function definition in both your posts is merely a copy-past failure.
    Last edited by Eri523; September 25th, 2010 at 09:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured