1.

What is the use of rank() function in C++?(a) Returns size of each dimension(b) Returns how many total elements can be stored in an array(c) Returns how many elements are in array currently(d) Returns the dimension of an arrayThis question was addressed to me during an online exam.My doubt stems from Array Type Manipulation topic in portion Class Hierarchies, Library & Containers of C++

Answer»

Correct OPTION is (d) Returns the DIMENSION of an ARRAY

The best I can EXPLAIN: rank() FUNCTION returns the rank of the array i.e. the dimension of an array. For example, int arr[10][10] has rank 2.



Discussion

No Comment Found

Related InterviewSolutions