By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,128 Members | 926 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,128 IT Pros & Developers. It's quick & easy.

const char *p;

P: 1
Which of the choices is true for the mentioned declaration ?

const char *p;

and

char * const p;

a) You can't change the character in both

b) First : You can't change the characterr &

Second : You can;t change the pointer

c) You can't change the pointer in both

d) First : You can't change the pointer &

Second : You can't chanage the character

e) None
Mar 14 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,510
Which of the choices is true for the mentioned declaration ?

const char *p;

and

char * const p;

a) You can't change the character in both

b) First : You can't change the characterr &

Second : You can;t change the pointer

c) You can't change the pointer in both

d) First : You can't change the pointer &

Second : You can't chanage the character

e) None
try writing a small test program and attempt to change the character pointed to and the pointer and see what happens
Mar 14 '07 #2

10K+
P: 13,264
Which of the choices is true for the mentioned declaration ?

const char *p;

and

char * const p;

a) You can't change the character in both

b) First : You can't change the characterr &

Second : You can;t change the pointer

c) You can't change the pointer in both

d) First : You can't change the pointer &

Second : You can't chanage the character

e) None
What do you think is correct?

P.S Renamed thread.
Mar 14 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.