[ create a new paste ] login | about

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

C, pasted on Nov 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<stdio.h>

main()
{
char p[2];
char a;
char str[56];
//ここまで宣言

gets(str);//入力

a=str[2];//aの変数にstr[56]の三番目の要素を格納

p[0]=a;//p[2]の一番目にaの値を代入
p[1]='/0';//p[2]の二番目に入力の終了の意味

printf("%s",p);//p[0]のポインタを渡す


}


Output:
1
2
(0
Exited: ExitFailure 2


Create a new paste based on this one


Comments: