CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Assume the following C variable declaration

int *A[10], B[10][10];

Of the following expressions

1. A[2]
2. A[2] [3]
3. B[1]
4. B[2] [3]

Which will not give compile-time errors if used as left hand side of assignment statements in a C program?

A
4 only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
1, 2 and 4 only
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
2 and 4 only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
2, 3 and 4 only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B 1, 2 and 4 only
Here int *A[10] is an array of 10 pointers.
Which can be A[2] [3] as its left hand side.
It can also be A[2] as its left hand side and also B[2] [3] can obviously be used as left hand side as it is given in declaration of B[10] [10] only, but B[1] can not be used because it is declared as 2-dimensional array.

flag
Suggest Corrections
thumbs-up
1
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Sarrus Rule
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon