[ create a new paste ] login | about

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

C++, pasted on Mar 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

void fun(char* p)
{
	char * temp= (char *)"String with length more than 10 symbols";
	while (*temp)
		*p++=*temp++;
}
int main()
{
	char * t = (char *)"0123456789";
	fun(t);
	cout << t << endl;
	return 0;
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: