[ create a new paste ] login | about

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

C, pasted on Oct 27:
1
2
3
4
5
6
7
8
9
10
11
#include <string.h>
int  main(void){
char *s1 = "hello";
char *s2 = "hello world";
char *s3 = "goodnight vienna";
char *res;
res = strstr(s1, s2);
sprintf("result %s\n", res);
res = strstr(s1, s3);
sprintf("result %s\n", res);
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: