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

I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.

1 Answers  


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers   CMC, Wipro,


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

0 Answers  


Do pointers store the address of value or the actual value of a variable?

0 Answers   Fidelity,


mplementation of stack using any programing language

1 Answers   Marlabs,






What is the -> in c?

0 Answers  


can we change the default calling convention in c if yes than how.........?

0 Answers   Aptech,


What is the use of linkage in c language?

0 Answers  


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

0 Answers  


What does %2f mean in c?

0 Answers  


What is variables in c?

0 Answers  


How do you generate random numbers in C?

0 Answers  


Categories