Open In App

C Quiz – 108 | Question 1

Like Article
Like
Save
Share
Report

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.




int* ptr1, ptr2;


(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


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads