Question
1. const char *a;
2. char* const a;
3. char const *a;
-Differentiate the above declarations.

Answers

1. 'const' applies to char * rather than 'a' ( pointer to a constant char )
*a='F' : illegal
a="Hi" : legal

2. 'const' applies to 'a' rather than to the value of a (constant pointer to char )
*a='F' : legal
a="Hi" : illegal
3. Same as 1.   Your Comment






Search
Can you Answer!!
  • Q Explain different types of ResultSets in jdbc?
  • Q pass by value & reference.
  • Q Light year is the unit of:
  • Q Who is the Author of the book titled as ‘The Book of Gold Leaves’
  • Q Four countries, Armenia, Bangladesh, Cairo and Denmark came in the final of a Judo championship. Thre are some conditions like a: If Cairo wins the gold and/or Denmark wins the bronze b: if Aremania won the gold and/or Bangladesh won the bronze c:..................... (I'm not sure about these conditions.There were three conditions) hint: In Judo bronze medal is given to two countries.
  • Q Which African country was founded by Americans
  • Q The first country to win the World cup cricket thrice?
  • Q What is the maximum size of a ci (control interval)?
  • Q Excise duties are levied by the Union but appropriated by the States, True or False?
  • Q How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
  • Q How do you disable multiple logins in the same client?