Interview Questions and Answers :: TCS
Home > Experience Archives > TCS > Interview Question Set 1 > Discussion
13. Can you just tell how to write Const char pointer. If I want to have const data.
Answer:
It will point to constant address
Char * const tmp = 'h';
I.e if we do char c = 'k';
tmp= &c; (throw error)
But we can change the tmp value
To have constant data
Const char *tmp='k';
Or
Char const *tmp='k';
Santosh
2 Sep, 2016 5:39 PM
It will point to constant address
Char * const tmp = 'h';
I.e if we do char c = 'k';
tmp= &c; (throw error)
But we can change the tmp value
To have constant data
Const char *tmp='k';
Or
Char const *tmp='k';
Char * const tmp = 'h';
I.e if we do char c = 'k';
tmp= &c; (throw error)
But we can change the tmp value
To have constant data
Const char *tmp='k';
Or
Char const *tmp='k';
Report Error
Report Error
Please Login First Click Here