No. of elements in an array?

1 view
Skip to first unread message

TheSuyog

unread,
Aug 12, 2010, 12:22:52 PM8/12/10
to Knowledge Test
void Function(int a[]);

This function takes an array as argument. What are the possible ways
to count the number of elements in this array? If it was an array of
chars we could simply check the element with val '\0', how about an
array of type int?

Pallavi Jajoo

unread,
Aug 13, 2010, 8:54:35 AM8/13/10
to knowledge-...@googlegroups.com


simply use length() function.....it ll give d no. f elements.....
applicable nly in java.. .....:)...
329.gif

rajas

unread,
Aug 13, 2010, 8:59:30 AM8/13/10
to knowledge-...@googlegroups.com


not only in java it is also applicable in c++ & c# ..
 bt what abt c . how we calculate the no of elements?
Reply all
Reply to author
Forward
0 new messages