[ create a new paste ] login | about

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

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

int main(int argc, char **argv)
{
int i;
     //ファイル名指定(コマンドライン引数として指定)
    if(argc < 4){
         printf("ファイル名をいれてください");
         scanf("%d", &i);
         sscanf(argv[1], "%d", &i);
         printf("文字列1をいれてください");
         scanf("%d", &i);
         sscanf(argv[2], "%d", &i);
         printf("文字列2をいれてください");
         scanf("%d", &i);
         sscanf(argv[3], "%d", &i);
    } else {
        perror(Error Bad argument.);
        return 0;
    }


Output:
1
2
3
4
5
6
In function 'main':
Line 18: error: 'Error' undeclared (first use in this function)
Line 18: error: (Each undeclared identifier is reported only once
Line 18: error: for each function it appears in.)
Line 18: error: expected ')' before 'Bad'
Line 20: error: expected declaration or statement at end of input


Create a new paste based on this one


Comments: