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.
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
Please Login to comment...