[ create a new paste ] login | about

Link: http://codepad.org/JEPQpv2v    [ raw code | output | fork ]

C++, pasted on Nov 2:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

int f(int & n) {
   std::cout << "Bad things are about to happen..." << std::endl;
   return n;
}

int main() {
    int * ptr = 0;
    f(*ptr);
}
    


Output:
1
2
3
Bad things are about to happen...

Segmentation fault


Create a new paste based on this one


Comments: