what is difference between ++(*p) and (*p)++

Answer Posted / alok kumar

++(*p) :- means that first increment the value of that variable which address holds p .than any operation will perform. ex:- int a=10;int *p; p=&a;
int c=++(*p);printf("%d,%d",c,*p);out put:-11 , 11 .


(*p)++ :- means that first assign the value than increment the value by 1. ex:- int a=10;int *p; p=&a;
int c=(*p)++;printf("%d,%d",c,*p);out put:-10 , 11 .

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain two-dimensional array.

633


How many types of functions are there in c?

587


Tell us bitwise shift operators?

603


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

673


What are the advantage of c language?

556






What are the two types of structure?

581


Who developed c language?

644


Differentiate between declaring a variable and defining a variable?

612


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

602


how to introdu5ce my self in serco

1527


How can I make it pause before closing the program output window?

585


What kind of structure is a house?

562


Explain how can I write functions that take a variable number of arguments?

619


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1881


What are the properties of union in c?

596