Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why double pointer is used in c?

1091


What is structure packing in c?

1140


What does sizeof function do?

1257


What is the purpose of void pointer?

1102


What is %d called in c?

1284


What is console in c language?

1143


Is c language still used?

1045


What is #include stdio h?

1180


Which node is more powerful and can handle local information processing or graphics processing?

1372


In C language what is a 'dangling pointer'?

1242


Can we access array using pointer in c language?

1129


How can you pass an array to a function by value?

1179


What is the difference between functions abs() and fabs()?

1214


Explain Basic concepts of C language?

1237


How do you initialize pointer variables?

1153