1.

What is meant by unsized array initialization in C++? What are its benefits?

Answer»

Unsized array initialization means skip the size of the array I an initialization statement. The C++, then automatically creates an array big enough to hold all the initializers present and calculates the dimensions of unsized arrays.

Example: char S1 [ ] = “First String”;

Advantages:

  • Less tedious.
  • Allow to change any of the values without fear of using incorrect array dimensions.
  • We may lengthen or shorten the value-list without changing the array dimensions.


Discussion

No Comment Found

Related InterviewSolutions