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...

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

Answer Posted / vint

++(*p) (or) ++*p -> Pre-increment the Value
(*p)++ -> Post-increment the value

*++p -> Increment the Position and then obtain the Value
*p++ (or) *(p++) -> Obtain the Value and then increment the Position

Example:
#include<stdio.h>
void main()
{
char str[10] = "Helyo";
char *p = str;
printf("%c
",++(*p)); // Pre-Increment the Value -> I
printf("%c
",++*p); // Pre-Increment the value -> J
printf("%c
",(*p)++); // Post-Increment the value -> J and increment to K

printf("%c
",*p++); // Post-Increment the position -> K and move to next position i.e. e
printf("%c
",*(p++)); // Post-Increment the position -> e and move to next position i.e. l
printf("%c
",*++p); // Pre-Increment the position and obtain value -> y

}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of endless loops?

1128


Can you explain the four storage classes in C?

1169


What does %p mean?

1157


What is class and object in c?

1177


What is the difference between ++a and a++?

1274


What is function what are the types of function?

1057


What is the difference between exit() and _exit() function?

1101


Why isnt there a numbered, multi-level break statement to break out

1100


what are enumerations in C

1218


what is the significance of static storage class specifier?

2343


Why do we use stdio h and conio h?

1136


Why do we use static in c?

1177


What is scope rule of function in c?

1150


Are pointers integers in c?

1123


How do you construct an increment statement or decrement statement in C?

1275