C++ Interview Question and Answers

21. What is array of strings?
 
  • An array of strings is a two – dimensional character array.
  • The size of first index (rows) determines the number of strings and the size of second index (column) determines maximum length of each string.
 
Your Name Your Email-ID
Your Answer
`
22. What is sorting?
  One can rearrange the data in a given array either in ascending or descending order. This process is called sorting.
 
Your Name Your Email-ID
Your Answer
23. What is matrix?
 
  • A matrix is a set of m*n numbers arranged in the form of a rectangular array of m rows and n columns.
  • Matrices can be represented through 2-D arrays.
 
Your Name Your Email-ID
Your Answer
24. Explain the memory representation of 2-D arrays?
  A 2-D array is stored in sequential memory blocks.
  • The elements are stored either, Row wise manner (this method is called as row-major order).
  • Column wise manner (this method is called as column-major order).
 
Your Name Your Email-ID
Your Answer
25. What are strings?
 
  • Strings are otherwise called as literals, which are treated as single dimension of characters. The declaration of strings is same as numeric array.
  • For examples Char name [10];
  • Char vowels [] = {'a', 'e', 'I', 'o', 'u'}
 
Your Name Your Email-ID
Your Answer
12345678910 Page 5 of 10