[ create a new paste ] login | about

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

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

int main()
{
	char *p;
	char s2[6]="abcd";
	char s1[6];
	p = strcpy(s1,s2);
	cout<<"s1 = "<<s1<<" adr = "<<hex<<&s1<<endl;
	cout<<"s2 = "<<s2<<" adr = "<<hex<<&s2<<endl;
	cout<<"p  = "<<p <<" adr = "<<hex<<&p<<endl;
	system("pause");
	return 0;
}


Output:
1
2
3
4
5
s1 = abcd adr = 0xbf783218
s2 = abcd adr = 0xbf78321e
p  = abcd adr = 0xbf783214

Disallowed system call: SYS_fork


Create a new paste based on this one


Comments: