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

    Error message regarding pointer

    Hi, i am making a form in visual C++ express edition...
    I have these lines in my code:

    int * SubTab;
    SubTab = &this->tabControl2->SelectedIndex;

    And I am getting this error message:


    - '&' requires l-value

    how can i do this?

    Basically, i want to be able to change the value of this->tabControl2->SelectedIndex through the pointer. I want to be able to also change which tabcontrol is being changed. For example, later in my code i have:

    SubTab = &this->tabControl3->SelectedIndex;

    so the tabcontrol should change... however, it is not allowing this type of information


    thanks

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Error message regarding pointer

    Try this:
    Code:
    SubTab = &(this->tabControl2->SelectedIndex);
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

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