fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int *ptr; // Declare integer pointer
  6. ptr = new int; //Allocate some memory for integer
  7. *ptr = 5; // Dereference to initialize the pointee
  8. *ptr = *ptr + 1; //We are dereferencing ptr in order
  9. //to add one to the value stored
  10. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty