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

Answer Posted / alok kumar

++(*p) :- means that first increment the value of that variable which address holds p .than any operation will perform. ex:- int a=10;int *p; p=&a;
int c=++(*p);printf("%d,%d",c,*p);out put:-11 , 11 .


(*p)++ :- means that first assign the value than increment the value by 1. ex:- int a=10;int *p; p=&a;
int c=(*p)++;printf("%d,%d",c,*p);out put:-10 , 11 .

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need previous papers of CSC.......plz help out by posting them.......

1814


What does sizeof function do?

610


In which header file is the null macro defined?

850


write a program in c language to print your bio-data on the screen by using functions.

6243


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

1508






What is difference between union and structure in c?

572


Explain how can I write functions that take a variable number of arguments?

608


How do you generate random numbers in C?

653


What is an operator?

656


What is a union?

608


What does the file stdio.h contain?

597


Why do we use stdio h and conio h?

631


largest Of three Number using without if condition?

1003


Is a house a shell structure?

690


What is the difference between text files and binary files?

674