How to access or modify the const variable in c ?
Answer Posted / vignesh
@Ramya
const value cannot be changed...you declared it wrong,
int *ptr = &x;
is not correct.It should be,
int ptr = &x;
also,according to your program only the *ptr value is 20 and
not the value of x
| Is This Answer Correct ? | 5 Yes | 51 No |
Post New Answer View All Answers
What are the application of void data type in c?
What is c language & why it is used?
What is string constants?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Write a program to swap two numbers without using third variable?
Is using exit() the same as using return?
can we change the default calling convention in c if yes than how.........?
What is a header file?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
Explain 'bit masking'?
Why we not create function inside function.
Give me the code of in-order recursive and non-recursive.
How can my program discover the complete pathname to the executable from which it was invoked?
Is r written in c?
How can I determine whether a machines byte order is big-endian or little-endian?