[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Pointers - Discussion

Home > C Programming > Pointers > MCQs Questions Discussion

41 / 60

Choose the correct option.

Which of the choices is true for the mentioned declaration?

const char *p;
and
char * const p;

Choose one of them:

AYou can't change the character in both

BIn first case, you can't change the character and second case you can’t change the pointer

CYou can't change the pointer in both

DIn first case you can't change the pointer and in second case you can't change the character

ENone of these

Answer: Option (Login/Signup)

Show Explanation

 const char *ptr : This is a pointer to a constant character. You cannot change the value pointed by ptr, but you can change the pointer itself. “const char *” is a (non-const) pointer to a const char.

char *const ptr : This is a constant pointer to non-constant character. You cannot change the pointer p, but can change the value pointed by ptr. 


Asked In :: TCS Accenture Amazon Capgemini Cognizant Goldman Sachs 8

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here