Question: 9. (Array Categories) We discuss some functions that work with array types. The rank of an array type is equal to the number of dimensions

9. (Array Categories)

We discuss some functions that work with array types. The rank of an array type is equal to the number of dimensions of the array. The extent of an array type is the number of elements along the Nth dimension of the array if N is in the closed interval [0, std::rank::value]. For any other type, the value is 0.

Answer the following questions:

a) Test std::is_array() on a range of fundamental, scalar, object, arithmetic and compound types.

b) Create an array int [][3][4][5]. Find its rank and extent.

c) Call std::remove_extent() and std::remove_all_extent() on the array in question b). What is happening?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting For Financial Instruments Questions!