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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a function declared as pascal do differently?

603


Can include files be nested? How many levels deep can include files be nested?

653


Explain what is a stream?

606


What is meant by initialization and how we initialize a variable?

581


Describe dynamic data structure in c programming language?

599






which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1126


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

661


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

601


What is a stream?

642


What is wild pointer in c?

601


find out largest elemant of diagonalmatrix

1646


What is a good data structure to use for storing lines of text?

591


What is getch() function?

645


What is the difference between local variable and global variable in c?

683


Explain which function in c can be used to append a string to another string?

582