ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
what is difference between ++(*p) and (*p)++
 Question Submitted By :: Sandipan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 1
++(*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 ?    3 Yes 0 No
S.aswini
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 2
++(*p)-->pre-increment.
(*p)++-->post-increment.
 
Is This Answer Correct ?    6 Yes 0 No
Kalai
 
 
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 3
++(*p)-->after the value is incremented, next line is 
executed.
(*p)++-->after execution,it is incremented.
 
Is This Answer Correct ?    2 Yes 0 No
Arasu
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 4
++(*p) means address that contained in p is incremented.

(*p)++ in this case since both the operator are unary
operator , so it's priority is from right to left.Hence here
first address that contained in p is incremented  & then
gives the value at that address.
 
Is This Answer Correct ?    0 Yes 2 No
Savita
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 5
value that contained in p is incremented. (p is pointer.)

++(*p) --> pre-increment.
(*p)++ --> post-increment.
 
Is This Answer Correct ?    0 Yes 0 No
Tejas
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 6
++(*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 ?    2 Yes 0 No
Ravi
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 7
++(*p)as this means the  first the addres is increneted and 
then address is assgined

*p++ as this mean that the address is assign to it then the 
address is incremented
 
Is This Answer Correct ?    0 Yes 1 No
Srinivas
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 8
++(*p)-> Here ,increments the address of p
(*p)++ -> Here , Increments the Value of p
 
Is This Answer Correct ?    3 Yes 2 No
Amaresh Chandra Das
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 9
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 ?    2 Yes 0 No
Vikram
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 10
++(*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 ?    1 Yes 0 No
Pooja
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 11
++(*p) it will increase pointer value to one value
(*p)++ will refer to next memory location
 
Is This Answer Correct ?    0 Yes 1 No
Sonal
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 12
Both are same ..................
reult will not differ in both operations....

#include <stdio.h>
#include <stdlib.h>
//#include <ctype.h>
void main()
{
char *ptr="hello";
clrscr();
//++(*ptr);
  (*ptr)++;
printf("%s\n",ptr);
getch();
}


check this code..........
 
Is This Answer Correct ?    1 Yes 3 No
Pradeep......
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 13
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 ?    1 Yes 0 No
Manju
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 14
++(*p)means first incrementing and then performing the
operation;
(*p)++ means first performing the operation and then
incrementing.
 
Is This Answer Correct ?    3 Yes 0 No
Vicky
 
  Re: what is difference between ++(*p) and (*p)++
Answer
# 15
p is a pointer variable which is holding the address of 
another variable ,*p indicates the value that stored in 
particular address

++(*p)-the value of the particular variable which is stored 
in p is first incremented and used by next instruction

(*p)++ -the value of the particular variable which is 
stored is executed or used by next instruction as it is 
what it was,if it is any looping statement first time the 
loop will be executed with the original value while doing 
the second looping it is incremented by 1
 
Is This Answer Correct ?    0 Yes 0 No
Umamaheswari
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101) Bosch1
What's wrong with "char *p = malloc(10);" ?  4
What should not contain a header file?  2
hat is a pointer? Assurgent3
Write code for finding depth of tree Adobe1
how to copy a string without using c function  5
what is pointer ? Kernex-Micro-Systems7
wats SIZE_T meant for?  1
Struct(s) { int a; long b; } Union (u) {int a; long b; } Print sizeof(s)and sizeof(u) if sizeof(int)=4 and sizeof(long)=4 Mascot2
can i know the source code for reversing a linked list with out using a temporary variable? Honeywell6
main() { float a=8.8; double b=8.8; if(a==b) printf("Equal"); else printf("not equal"); getch(); } what is the output? with reason  3
44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?  3
a C prog to swap 2 no.s without using variables just an array? TCS4
what is meant by c  4
what are brk, sbrk? Oracle1
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student" IBM4
Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning Accenture4
prototype of sine function. Cadence2
what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason  3
how to find out the inorder successor of a node in a tree?? TCS2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com