質問編集履歴
1
実行結果の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
【ソース】
|
8
8
|
|
9
|
-
|
9
|
+
include <stdio.h>
|
10
10
|
|
11
11
|
|
12
12
|
|
@@ -41,3 +41,45 @@
|
|
41
41
|
agrv[2] = b
|
42
42
|
|
43
43
|
agrv[3] = c
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
また以下のソースで実行するとプログラム名しか表示されません。
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
【ソース】
|
52
|
+
|
53
|
+
include <stdio.h>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
int main(int argc,char **argv){
|
58
|
+
|
59
|
+
int i;
|
60
|
+
|
61
|
+
for(i=0;i<argc;i++){
|
62
|
+
|
63
|
+
printf("argv[%d] = %s\n",i,*argv);
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
return 0;
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
【実行結果】
|
78
|
+
|
79
|
+
PS C:\Program Files (x86)\programming> .\a.exe a b
|
80
|
+
|
81
|
+
argv[0] = C:\Program Files (x86)\programming\a.exe
|
82
|
+
|
83
|
+
argv[1] = C:\Program Files (x86)\programming\a.exe
|
84
|
+
|
85
|
+
argv[2] = C:\Program Files (x86)\programming\a.exe
|