difference between i++* and *++i

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a function method?give example?

2135


can any one tel me wt is the question pattern for NIC exam

1758


What is a static variable in c?

877


Explain what is a stream?

814


What is use of #include in c?

840


What are the preprocessor categories?

836


What is dangling pointer in c?

824


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

835


What is a list in c?

803


What is the sizeof () operator?

802


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

984


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1683


What is optimization in c?

759


What is the condition that is applied with ?: Operator?

899


What are the key features in c programming language?

834