[ create a new paste ] login | about

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

C++, pasted on Dec 11:
1
2
3
4
5
6
7
8
9
10
11
#include <string>
using namespace std;

int main()
{
	string *s = static_cast<string*>( ::operator new[](sizeof(string)*2) );
	new(s) string();
	new(s+1) string();

	delete[] s;
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: