Skip to content

Instantly share code, notes, and snippets.

@imduffy15
Created March 29, 2013 17:01
Show Gist options
  • Select an option

  • Save imduffy15/5272116 to your computer and use it in GitHub Desktop.

Select an option

Save imduffy15/5272116 to your computer and use it in GitHub Desktop.
#include <iostream>
int main() {
std::string * pointers[10];
memset(&pointers,0,sizeof pointers);
pointers[0] = new std::string("Hello");
pointers[5] = new std::string("I'm index 5");
for(int i=0;i<10;i++) {
if(pointers[i] != 0) {
std::cout << *pointers[i] << "\n";
} else {
std::cout << pointers[i] << "\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment