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

Explain union.

1170


What is difference between arrays and pointers?

1076


How do you do dynamic memory allocation in C applications?

1089


Why should I use standard library functions instead of writing my own?

1272


What is a structure and why it is used?

1229


What is pragma in c?

1219


What are the different data types in C?

1205


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1089


Write program to remove duplicate in an array?

1083


Should I learn c before c++?

1237


What are preprocessor directives in c?

1102


How do you declare a variable that will hold string values?

1179


What are the benefits of organizational structure?

1029


How to implement a packet in C

2889


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1034