Discussion
If a two dimensional array is used as a formal parameter, then
Answer: B
Correct answer: the first (row) subscript may be left empty
For a two-dimensional parameter the compiler needs the row length - the number of columns - to compute a[i][j] as *(base + i*cols + j). The number of rows is never used in that arithmetic, so void f(int a[][10]) is legal while void f(int a[10][]) is not. Leaving the first subscript out is optional, not required.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development