Dynamic Memory Allocation Base And Liit Code Example


Example: dynamic memory allocation

int *p = new int; // request memory *p = 5; // store value  cout << *p << endl; // Output is 5  delete p; // free up the memory  cout << *p << endl; // Output is 0

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable