Get length of an Array using a pointer

后端 未结 6 1798
广开言路
广开言路 2021-01-03 05:25

Is there a way to get the length of an Array when I only know a pointer pointing to the Array?

See the following example

int testInt[3];
testInt[0] =         


        
6条回答
  •  走了就别回头了
    2021-01-03 06:12

    • You can infer the length of an array if you have an array variable.
    • You cannot infer the length of an array if you have just a pointer to it.

提交回复
热议问题