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
What are local static variables?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
Are the expressions * ptr ++ and ++ * ptr same?
where are auto variables stored? What are the characteristics of an auto variable?
What is the difference between NULL and NUL?
How to set file pointer to beginning c?
What oops means?
Explain about the constants which help in debugging?
What do header files do?
How can you avoid including a header more than once?
Can we change the value of #define in c?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
What happens if you free a pointer twice?
What is this pointer in c plus plus?