Skip to content

Instantly share code, notes, and snippets.

@dacap
Created August 11, 2016 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacap/504411661dc63e8be028d074474fcef7 to your computer and use it in GitHub Desktop.
Save dacap/504411661dc63e8be028d074474fcef7 to your computer and use it in GitHub Desktop.
C++ crash
#include <iostream>
#include <string>
struct Person {
std::string name;
};
int main() {
Person* p = nullptr;
std::cout << (p ? p->name: nullptr) << "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment