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

When should volatile modifier be used?

1018


Is main an identifier in c?

1147


How can you convert integers to binary or hexadecimal?

1038


Is that possible to add pointers to each other?

1377


How is pointer initialized in c?

1030


What is a const pointer?

1129


What are nested functions in c?

1026


What is realloc in c?

1121


What are the data types present in c?

1166


C language questions for civil engineering

1722


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

1282


The statement, int(*x[]) () what does in indicate?

1151


Explain what are binary trees?

1083


Can we declare variable anywhere in c?

979


Do you know pointer in c?

1056