Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


difference between i++* and *++i

Answers were Sorted based on User's Feedback



difference between i++* and *++i..

Answer / ravi

i++* is meaningless , do u want to ask *++i and *i++ diff ?

*++i --> it increments the i then access the value poiting
by i

*i++ --> it first access the value pointed by i , then
increment the i ( increments pointer , not value)

Is This Answer Correct ?    21 Yes 2 No

difference between i++* and *++i..

Answer / gv_shreenivas

The postfix ++ and -- operators essentially have higher
precedence than the prefix unary operators. Therefore, *i++
is equivalent to *(i++); it increments i, and returns the
value which i pointed to before i was incremented. To
increment the value pointed to by i, use (*i)++ (or perhaps
++*i, if the evaluation order of the side effect doesn't
matter).

Ref:comp.lang.c FAQ list ยท Question 4.3

Is This Answer Correct ?    7 Yes 4 No

difference between i++* and *++i..

Answer / yathish m yadav

*++i
assuming i is declared as pointer
i will be first incremented to point to next location to
which it is pointing. then, the content of location to
which i is newly pointing will be assigned if any variable
is used like: a=*++i;
here since it is not assigned to any variable it will be
dicard.

i++*
if the statement is int a=i++*;
then i is incremented to point to next location of its type
then the content of that location is being copied to a
using *.

Is This Answer Correct ?    2 Yes 0 No

difference between i++* and *++i..

Answer / vignesh1988i

i++* wont work .... as for as i know.... it's meaningless

comin to *++i, i is a pointer holding an address so here ++
and * holds the same priority so we ll go for associativity
of these operators. it's RIGHT to LEFT.

so , address in 'i' will get incremented and then if that
address points to some value means it will print that value
or else it will have garbage value



thank u

Is This Answer Correct ?    3 Yes 2 No

difference between i++* and *++i..

Answer / rukmanee

In case of i++, it'll first assign the value of i and then
increment it's value by one. But in case of ++i, it 'll
first increment the value of i by 1 and then assign the new
value of i.This is the difference between i++ and ++i.

Is This Answer Correct ?    2 Yes 2 No

difference between i++* and *++i..

Answer / khaja

it wont work bcoz its meaning less
bcoz i++* is not an increment operator(post increment)
*++i is to not a pre increment operator...

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More C Interview Questions

what is data structure?

5 Answers   CBSE,


Why is the code below functioning. According to me it MUST NOT.

1 Answers  


Why functions are used in c?

0 Answers  


What is the output for the below program? void main() { float me=1.1; double you=1.1; if(me==you) printf("love c"); else printf("know c"); }

7 Answers  


What is chain pointer in c?

0 Answers  


what is a function pointer and how all to declare ,define and implement it ???

4 Answers   Honeywell,


program to locate string with in a string with using strstr function

2 Answers   Huawei, Shreyas,


find largest element in array w/o using sorting techniques.

3 Answers   Zycus Infotech,


What are function pointers? Provide an example.

1 Answers  


Why we not create function inside function.

0 Answers  


how to find turn around time in operating system?

3 Answers  


What is %lu in c?

0 Answers  


Categories