CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005
    Posts
    55

    a simple question

    Hi,

    I have a very simple question.

    "ptr" is a pointer to a "struct", "value" is a member (there are other members also) of this "struct" and "x" is an integer. What does following code return:


    return (ptr + x)->value.

    Thanks.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,902

    Re: a simple question

    Same thing as ptr[x].value. A pointer can be treated as a pointer to a single object, or an array of objects.

    gg

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