[ create a new paste ] login | about

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

C, pasted on Aug 31:
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
//char sc(char *str);
int main()
{
    char *str;
    int k,i;
    *str="fdfsfdsafd";
    for(i=0;str[i];i++,k++);
    printf("%d",k);
    getchar();
    return 0;    
}


Output:
1
Segmentation fault


Create a new paste based on this one


Comments: