4 votes 4 votes Prior to using a pointer variable it should be declared. initialized. both declared and initialized. none of these. Programming in C nielit2016mar-scientistb programming-in-c pointers + – admin asked Mar 31, 2020 edited Oct 1, 2020 by Lakshman Bhaiya admin 2.0k views answer comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments neel19 commented May 11, 2022 reply Follow Share The comment above has explained it better. It is even confirmed by Arjun sir. The first time assigning a value to a pointer variable is initialization. If we reassign a value to that pointer variable again that’s an assignment. We can have a pointer variable that isn’t initialized. But dereferencing an uninitialized pointer is invalid. This is what I understood. 0 votes 0 votes shishir__roy commented May 11, 2022 reply Follow Share But still you said initialisation is not necessary. Without initialisation, pointer will always point to some invalid memory location. And using (dereferencing) it may result in runtime error. 0 votes 0 votes neel19 commented May 11, 2022 reply Follow Share Yup, it isn’t. Is anything wrong with it? 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes int a = 10; int *ptr; //pointer declaration ptr = &a; //pointer initialization or int *ptr = NULL; return 0; answer c is correct abhishek tiwary answered Apr 27, 2020 abhishek tiwary comment Share Follow See all 0 reply Please log in or register to add a comment.