fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int s[5] = {1, 2 , 3, 4, 5};
  6.  
  7. int *p = s;
  8.  
  9. int first = *(p++);
  10. int sec = *++p;
  11. int third = ++*p;
  12. int fourth = *p++;
  13.  
  14. cout << "*p++ is " << first << endl
  15. << "*++p is " << sec << endl
  16. << "++*p is " << third << endl
  17. << "*p++ is " << fourth << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 4488KB
stdin
Standard input is empty
stdout
*p++ is 1
*++p is 3
++*p is 4
*p++ is 4