How to access or modify the const variable in c ?
Answer Posted / ramya
const int x = 10;
int *ptr = &x;
*ptr = 20;
printf ("Value of x is %d\n", x);
Even though the variable x is const the value gets changed..
And its one of the drawback in c..
| Is This Answer Correct ? | 28 Yes | 31 No |
Post New Answer View All Answers
Describe the steps to insert data into a singly linked list.
Is c is a high level language?
What is the general form of function in c?
What is the difference between a function and a method in c?
Explain what are compound statements?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
write a program to print largest number of each row of a 2D array
What are the different types of objects used in c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What is the difference between array and linked list in c?
How can I ensure that integer arithmetic doesnt overflow?
What is the difference between printf and scanf )?
Are pointers integer?
What does the format %10.2 mean when included in a printf statement?
What is a structure in c language. how to initialise a structure in c?