Array length problem

后端 未结 6 1487
栀梦
栀梦 2021-01-21 07:46

I was reading a csc placement paper where I read a question related to c language array\'s sizeof() operator. Answer was something else then i expected it to be.



        
6条回答
  •  囚心锁ツ
    2021-01-21 08:22

    You need to pass the length to the function, or create a struct that includes both a pointer to the array and the length of the array. There is no size information stored with C arrays.

提交回复
热议问题