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

Describe the steps to insert data into a singly linked list.

1067


Is c is a high level language?

1192


What is the general form of function in c?

1020


What is the difference between a function and a method in c?

1077


Explain what are compound statements?

1054


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)

1089


write a program to print largest number of each row of a 2D array

2321


What are the different types of objects used in c?

1023


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1164


What is the difference between array and linked list in c?

1144


How can I ensure that integer arithmetic doesnt overflow?

1158


What is the difference between printf and scanf )?

1086


Are pointers integer?

1003


What does the format %10.2 mean when included in a printf statement?

1645


What is a structure in c language. how to initialise a structure in c?

1060