Data-Structures
October 16, 2023
Data-Structures
October 16, 2023
Data-Structures
October 16, 2023
Data-Structures
October 16, 2023

Data-Structures

Question 48

Assume the following C variable declaration

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

Of the following expressions

I. A[2]     II. A[2][3]     III. B[1]     IV. B[2][3]  

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

A
I, II, and IV only
B
II, III, and IV only
C
II and IV only
D
IV only
Question 48 Explanation: 
i) A[2] can be consider as a pointer and this will not give any compile-time error.
ii) A[2][3] This results an integer, no error will come.
iii) B[1] is a base address of an array. This will not be changed it will result a compile time error.
iv) B[2][3] This also results an integer. No error will come.
Correct Answer: A
Question 48 Explanation: 
i) A[2] can be consider as a pointer and this will not give any compile-time error.
ii) A[2][3] This results an integer, no error will come.
iii) B[1] is a base address of an array. This will not be changed it will result a compile time error.
iv) B[2][3] This also results an integer. No error will come.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!