C Quiz – 108 | Question 1

In the below statement, ptr1 and ptr2 are uninitialized pointers to int i.e. they are pointing to some random address that may or may not be valid address.

filter_none

edit
close

play_arrow

link
brightness_4
code

int* ptr1, ptr2;

chevron_right


(A) TRUE
(B) FALSE


Answer: (B)

Explanation: Even though * is placed closer to int, * would be associated to ptr1 only but not to ptr2. It means that “int* ptr1” is equal to “int *ptr1”. That’s why only ptr1 is uninitialized pointer to int. Basically, though both ptr1 and ptr2 are uninitialized variables yet ptr1 is pointer to int while ptr2 is variable of type int. If we really want to make both variables as pointers, we need to mention them as “int *ptr1, *ptr2;”

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.