What is the difference between constant to pointer and pointer to constant?
No | Pointer to Constant | Constant Pointers |
---|---|---|
1 | *ptr = 20 Statement is Invalid in Pointer to Constant i.e Assigning Value is Illegal | *ptr = 20 is Absolutely Valid in Constant Pointers i.e Assigning Value is Perfectly legal |
2 | ptr ++ Statement is Valid in Pointer to Constant | ptr ++ Statement is Valid in Constant Pointers |
3 | Pointer Can be Incremented and Decremented | Pointer Cannot be Incremented and Decremented |
4 | Pointer is Pointing to Constant Data Object | Constant Pointer is Pointing to Data Objects |
5 | Declaration : const int *ptr ; | Declaration : int * const ptr ; |

Tags / Keywords : | Constant Pointer, Pointer to Constant Object, What is the difference between constant to pointer and pointer to constant?
0 Comments:
Post a Comment
Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email