What is the difference between the following declarations? const char *s; char const *s;

No difference


This question is related to Sonata Interview

Showing Answers 1 - 3 of 3 Answers

Tonni

  • Apr 7th, 2007
 

No difference. const either refers to the item on it's left, or if there is no item on the left, to the item on the right. So both lines declare s as a variable pointer to a constant character.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions