Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    Glad you got it.
  2. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    Did you add the println statements to EVERY where that gindex gets a value?
    That includes in the constructor of the class where the object with the gindex variable is created?

    In post #8 I asked...
  3. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    Do you know why the value is not different?
    If you understand that, you will be able to see a way to change it so each is different.
  4. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    If you change the value of a variable via one path and it changes the value of the variable that is on another path, what does that imply? There is only ONE variable. All the different paths point...
  5. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    Does your code set them to have the same values?

    I'll suggest it again, add printlns to your code to display the values of the variables every time they are set. The printout should show you...
  6. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    I don't see any printouts in your post that shows where the value was set to 8.
    In fact there don't appear to be any printouts for any time the value of the variable was changed.

    I suggested: ...
  7. Replies
    14
    Views
    1,670

    Re: my pointer's value is the same when referencing

    Add some printlns to show the values of those variables as they are being set and as they are referenced.

    What is the problem with the values being the same? Many variables can have the same value...
Results 1 to 7 of 7