How to access or modify the const variable in c ?

Answer Posted / mr.x

int main()
{
const volatile int no=10;
int *ptr;
ptr=(int *)&no;
*ptr=30;
printf("%d %d",no,*ptr);

return 0;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I read data from data files with particular formats?

591


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1451


What is the purpose of void in c?

608


I heard that you have to include stdio.h before calling printf. Why?

576


can anyone suggest some site name..where i can get some good data structure puzzles???

1636






Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

657


With the help of using classes, write a program to add two numbers.

609


Is c++ based on c?

640


Why header file is used in c?

560


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

602


what is the basis for selection of arrays or pointers as data structure in a program

3779


Calculate 1*2*3*____*n using recursive function??

1503


Explain the difference between malloc() and calloc() function?

590


how we can make 3d venturing graphics on outer interface

3981


Why is c so important?

584