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
  • 131
  • 1
  • 16

2 Answers2

0

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

Liam Potter
  • 1,732
  • 8
  • 24
  • 47
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
  • 4,034
  • 1
  • 20
  • 40