turbo_ c++

how to find size of array in c++(IN TURBO C++)? sizeof(array)/sizeof(array[0])->doesn’t seem to work outside main.
how to include vector.h while working in turbo c++?TURBO C++ doesn’t seem to have header files related to vector!Please suggest!

see this code…[LINK][1]!!!

it is giving the size…if i may have understood your ques wrong…then pls give the code or its snippet where it does not work…!!!
[1]: http://ideone.com/cpVWou

well i am talking about this in turbo c++.

Sorry, we can never find the sizeof array outside the main… in turbo c++… because of the fact- size of a pointer can’t determined…

Similarly if an array declared in one function(like main() func.) and passed to another function is like using a pointer to point the array… and as everybody know pointer to an array means pointer is pointing the first index of the array…

hence there is no way to find the array size outside…

i think m1m9_94 is correct.there is no way to determine size of array. we have to pass array and count into function.

Do not use Turbo C++… have a look at this

1 Like