0

I got an array of pointers of my Class:

myclass *v[3];
myclass *p;
v[0] = p;

I know that I can get the adress with val=v[0]. But how can I get the Value of v[0]?

jofri
  • 121
  • 1
  • 16

2 Answers2

0

Use the dereference operator * e.g. *arr[0]

Liam Potter
  • 1,632
  • 7
  • 24
  • 45
0

v[0] is a pointer. TO access the value of a pointee, you need to dereference it. Use the dereference operator, that is *.

*v[0]
kkica
  • 3,964
  • 1
  • 19
  • 40