by
What is difference between Indirection operator with post-increment operator?

1 Answer

0 votes
by
Indirection operator with post-increment operator: #include int main(void) { int aiData[5] = {100,200,30,40,50}; int *piData = aiData; *piData++; printf("aiData[0] = %d, aiData[1] = %d, *piData = %d", aiData[0], aiData[1], *piData); return 0; } Output: 100, 200, 200 Explanation: In the above example, two operators are involved and both have different precedence. The precedence of post ++ is higher than the *, so first post ++ will be executed and above expression, *p++ will be equivalent to *(p++). In another word you can say that it is post-increment of address and output is 100, 200, 200.

Related questions

0 votes
    What is the meaning of the below declarations? 1. const int a; 2. int const a; 3. const int *a; 4. int * const a; 5. int const * a const;c...
asked Jan 21, 2021 by JackTerrance
0 votes
    Can we declare a variable be both constant and volatile in C?...
asked Jan 23, 2021 by JackTerrance
0 votes
    Can we have a volatile pointer?...
asked Jan 23, 2021 by JackTerrance
0 votes
    Why trash rack is used?...
asked Jan 28, 2021 in Education by JackTerrance
0 votes
    What is Indirection and Increment/Decrement operators with a pointer in C?...
asked Jan 24, 2021 in Technology by JackTerrance
0 votes
    What is Indirection or Dereference Operator ( * )?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    Is it considered "bad style" to use the increment operator (++) on floats? It compiles just fine ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    when increment operator is used what will be the value of sum, if sum=2 and a=15 Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    when increment operator is used. what will be the value of sum, if sum=2 and a=15 Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    What is the difference between post-database commit and post-form commit?...
asked Dec 18, 2020 in Technology by JackTerrance
0 votes
    What is the difference between PUT and POST operations?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    What is the difference between equals() and method and == operator? Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    Difference between Floor division and Division operator? please tell fast and correct Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
+1 vote
    What is indirection in C-programming?...
asked Nov 8, 2020 in Technology by JackTerrance
0 votes
    What are the differences between get and post method?...
asked Sep 28, 2021 in Technology by JackTerrance
...