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

Answers were Sorted based on User's Feedback



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

Answer / kalai

++(*p)-->pre-increment.
(*p)++-->post-increment.

Is This Answer Correct ?    14 Yes 4 No

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

Answer / pooja

++(*p) means that first increment the value which is in
pointer p and then starts further execution.

(*p)++ means that first value is assigned and then
incremented.

Is This Answer Correct ?    6 Yes 0 No

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

Answer / vicky

++(*p)means first incrementing and then performing the
operation;
(*p)++ means first performing the operation and then
incrementing.

Is This Answer Correct ?    6 Yes 0 No

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

Answer / arasu

++(*p)-->after the value is incremented, next line is
executed.
(*p)++-->after execution,it is incremented.

Is This Answer Correct ?    6 Yes 1 No

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

Answer / s.aswini

++(*p)-->it is denoted by first increment the value andthen
check the condition.
(*p)++-->it is denoted by first do the operation and then
increment the value.

Is This Answer Correct ?    6 Yes 2 No

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

Answer / ravi

++(*p)-> indicates increment the value pointed by pointer p.

(*p)++ -> indicates increment the address of p then retrieve
the value pointed to by p.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / tejas

value that contained in p is incremented. (p is pointer.)

++(*p) --> pre-increment.
(*p)++ --> post-increment.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / vikram

here,*is the value at address operater;
according to heirarchy of operators,*is given the first
preference and then ++;
++(*p) means first incrementation of value at address of p
takes place and then execution takes place;
on the other hand,(*p)++ means first execution takes place
and then value at address of p is incremented

Is This Answer Correct ?    4 Yes 2 No

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

Answer / manju

both increments the value not the address. but the
difference lies in post and pre increment..
for example
main()
{
int i=2,*p;
p=&i;
}

when (*p)++ is given the o/p will be 2.
and in next line the value is incremented. in ++(*p)
the value is 3 since it is post

Is This Answer Correct ?    2 Yes 0 No

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

Answer / 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

More C Interview Questions

How can I pad a string to a known length?

0 Answers  


What is integer constants?

0 Answers  


suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan

1 Answers  


Differentiate between a structure and a union.

0 Answers   Zensar,


Explain how do you determine the length of a string value that was stored in a variable?

0 Answers  






What is build process in c?

0 Answers  


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;i<n1-1;i++) { if( !( (a1[i]>a1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

0 Answers   Facebook,


What is the difference between null pointer and void pointer

10 Answers   CTS, Manforce, MAQ Software,


What does struct node * mean?

0 Answers  


Explain the advantages and disadvantages of macros.

0 Answers   TCS,


Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + +

1 Answers  


Study the Following Points: a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static 1. Which of the Following Statements are true w.r.t Bit- Fields A)a,b&c B)Only a & b C)Only c D)All

3 Answers   Accenture,


Categories