NOTE: I'm not trying to solve a programming problem; I'm trying to learn.
Given this c++ code:
#include <iostream>
class class1
{
public:
int attr1 = 12;
class1()
{
} // breakpoint
};
int main()
{
class1 c1;
}
Using VS2019; breakpoint set per above. In Immediate Window:
this
0x000000877f54fcf4 {attr1=0x0000000c }
attr1: 0x0000000c
attr1
0x0000000c
class1::attr1
0x0000000c
&(class1::attr1) (am able to use "class1" here, I assume, because it's clear I'm not referring to a typename)
0x000000877f54fcf4 {0x0000000c}
class1 (returns blank line?)
&class1 (treats class1 as type)
type name is not allowed
Also, in Memory window, entering "class1" in Address
field shows:
Unable to evaluate the expression.
At the breakpoint, my questions:
- How can I get the address of class1 in the immediate window by using the identifier "class1"? (yes, I know it's the same address as "this")
- Same question re: Memory window
- Why does "class1" in Immediate Window return blank?