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...

study the code:
#include<stdio.h>
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf("a=%dn(*p)=%dn",a,*p);
}
What is printed?
A)100,101 B)100,100 C)101,101 D)None of the
above

Answer Posted / abdur rab

the answer is c) 101, 101

a constant variable can be accessed using a pointer to
change the value because, during compilation the compiler
cannot see that the pointer is changing a contant read only
variable.

the same method can be applied over the private members in
a c++ class also.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 1f in c?

2570


what are bit fields in c?

1598


Why do we use c for the speed of light?

1103


What are keywords in c with examples?

1039


What is I ++ in c programming?

1059


What is the use of typedef in structure in c?

917


What is the general form of #line preprocessor?

949


What does typedef struct mean?

1044


Explain how can I make sure that my program is the only one accessing a file?

1167


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

994


How can I remove the trailing spaces from a string?

1025


What is a pointer in c?

1417


What is the difference between class and object in c?

1088


What is a stream in c programming?

1080


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1030