-2

I have a variable of type float[] in C++. The variable is defined in a third-party header file and accessible from my source code. Can I get the size of the variable at run-time?

zell
  • 9,830
  • 10
  • 62
  • 115

1 Answers1

0

If this array was not allocated dynamically, you can do this

int size=sizeof(array)/sizeof(array[0])

This will not work if you are using an array created dynamically.

Gatchan00
  • 11
  • 2