Thread: Object not showing member values

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    18

    Object not showing member values

    Hi,

    Its been a while since I did any programming, so my error maybe obvious to you guys, but the problem I'm having is that when I construct a new object, the debugger isn't showing the objects member variables values, just the name of the object. So it looks as if the object is being created, but all of its contents are being lost, if that makes sense.

    I'm using Visual Studio Community 2017.

    This is the constructor:
    Code:
    Session sessiona = new Session(email, password, timeToWaitMin, timeToWaitMax, groupUrls);
    And this is the definition:

    Code:
    class Session
        {
            public Session(string email, string password, int timeToWaitMin, int timeToWaitMax, string[] groupUrls)
            {
                
                string _email = email;
                string _password = password;
                int _timeToWaitMin = timeToWaitMin;
                int _timeToWaitMax = timeToWaitMax;
                string[] _groupUrls = groupUrls;
            }
        }
    But hopefully you can see in the image below that the object's name is showing (sessiona), but there is no dropdown icon to the left of the name for me to check the values of the member variables, it just isn't there, as if teh object has been created, but it has none of the values I passed to the constructor.

    Can anyone suggest why I cannot see them at all?

    Many thanks
    Object not showing member values-jpg
    Attached Images Attached Images Object not showing member values-jpg 
    Last edited by Orange Lozenge; 4 Days Ago at 12:23 PM.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    18
    Just to say I have solved my problem.

    I had declared the member variables inside the class declaration.

    I have now declared them outside of the declaration and now I can see the member variable values during debug.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 07-09-2018, 06:34 AM
  2. Input showing as default values
    By worl4125 in forum C++ Programming
    Replies: 3
    Last Post: 12-01-2013, 11:27 AM
  3. Replies: 10
    Last Post: 05-22-2009, 11:12 PM
  4. Object not showing Polymorphic Behaviour
    By noobcpp in forum C++ Programming
    Replies: 24
    Last Post: 10-03-2008, 02:26 AM
  5. Sizeof static member object?
    By jw232 in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 11:36 AM

Tags for this Thread