SHARE
TWEET

Segfault

Archon Feb 27th, 2013 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <string>
  2. #include <cstdlib>
  3.  
  4. int main(){
  5.     std::string *p = (std::string *)malloc(sizeof(std::string));
  6.     *p = "asdf";
  7. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Top