what is difference between ++(*p) and (*p)++
Answers were Sorted based on User's Feedback
Answer / kalai
++(*p)-->pre-increment.
(*p)++-->post-increment.
Is This Answer Correct ? | 14 Yes | 4 No |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
How can I pad a string to a known length?
What is integer constants?
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
Differentiate between a structure and a union.
Explain how do you determine the length of a string value that was stored in a variable?
What is build process in c?
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 }
What is the difference between null pointer and void pointer
10 Answers CTS, Manforce, MAQ Software,
What does struct node * mean?
Explain the advantages and disadvantages of macros.
Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + +
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