What is showed by the command com NestedLessLess p NestedLes

What is showed by the command com NestedLessLess p NestedLessLess endl;? Consider the statement presented in point 8. What is showed by the command count NestedLessLess *p + 2 NestedLessLess endl;? Consider the following statement #include #include using namespace std; int main() {int n; array my Array; return 0;} Explain why the complier will show an error?

Solution

Assuming the headerfile <array> contains the class array is a generic class (template),

The error is in the statement   

array <int, n> myArray;

because a \'n\' is mentioned in < >. In a generic scenario, when we create an object, we mention only the datatype within <> . ,

\'n\' is a variable.

The correct statement is

array <int> myArray(n) // if you want to pass n as an arument or

array <int> myArray; // you want to pass no argument

 What is showed by the command com NestedLessLess p NestedLessLess endl;? Consider the statement presented in point 8. What is showed by the command count Neste

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site