質問編集履歴
7
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
コード
|
8
8
|
|
9
9
|
```
|
10
|
+
|
11
|
+
```ここに言語を入力
|
10
12
|
|
11
13
|
#include<stdio.h>
|
12
14
|
|
@@ -52,6 +54,8 @@
|
|
52
54
|
|
53
55
|
|
54
56
|
|
57
|
+
```
|
58
|
+
|
55
59
|
|
56
60
|
|
57
61
|
(1)の段階では、index[0]=?,index[1]=?,index[2]=?の状態。
|
6
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
```C言語
|
6
6
|
|
7
7
|
コード
|
8
|
+
|
9
|
+
```
|
8
10
|
|
9
11
|
#include<stdio.h>
|
10
12
|
|
5
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
|
7
7
|
コード
|
8
8
|
|
9
|
-
|
9
|
+
#include<stdio.h>
|
10
10
|
|
11
|
-
|
11
|
+
#define N 100
|
12
12
|
|
13
13
|
void find(int*);/*プロトタイプ宣言*/
|
14
14
|
|
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
|
52
52
|
|
53
|
-
|
53
|
+
|
54
54
|
|
55
55
|
(1)の段階では、index[0]=?,index[1]=?,index[2]=?の状態。
|
56
56
|
|
4
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,6 +48,10 @@
|
|
48
48
|
|
49
49
|
}
|
50
50
|
|
51
|
+
|
52
|
+
|
53
|
+
```
|
54
|
+
|
51
55
|
(1)の段階では、index[0]=?,index[1]=?,index[2]=?の状態。
|
52
56
|
|
53
57
|
(2)の段階では、list[0]=0,list[1]=1,list[2]=2というようにlistの中身が分かる。-(A)
|
3
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,13 +6,9 @@
|
|
6
6
|
|
7
7
|
コード
|
8
8
|
|
9
|
-
```
|
9
|
+
```#include<stdio.h>
|
10
10
|
|
11
|
-
#include<stdio.h>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
#define N 100
|
11
|
+
#define N 100
|
16
12
|
|
17
13
|
void find(int*);/*プロトタイプ宣言*/
|
18
14
|
|
2
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,51 +1,75 @@
|
|
1
1
|
いつもお世話になっています。C言語初心者で勉強中です。以下の分からないところを教えてください。
|
2
2
|
|
3
|
-
|
3
|
+
以下が、コードです。
|
4
4
|
|
5
|
-
|
5
|
+
```C言語
|
6
|
+
|
7
|
+
コード
|
8
|
+
|
9
|
+
```
|
6
10
|
|
7
11
|
#include<stdio.h>
|
8
12
|
|
13
|
+
|
14
|
+
|
9
15
|
#define N 100
|
10
16
|
|
11
|
-
|
17
|
+
void find(int*);/*プロトタイプ宣言*/
|
12
18
|
|
13
|
-
int i
|
19
|
+
int main(){
|
14
20
|
|
15
|
-
int i
|
21
|
+
int i;
|
16
22
|
|
17
|
-
|
23
|
+
int index[N];/*配列を宣言する。-(1) */
|
18
24
|
|
19
|
-
f
|
25
|
+
find(index);/*indexの配列を関数で実引数として使う。 */
|
20
26
|
|
27
|
+
for(i=0;i<5;i++){
|
28
|
+
|
21
|
-
printf("index[%d]=%d\n",i, index[i]);
|
29
|
+
printf("index[%d]=%d\n",i, index[i]);
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
return 0;
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
void find(int *list)/*indexの配列がlistに送られる。*/
|
38
|
+
|
39
|
+
{
|
40
|
+
|
41
|
+
int i,n=0;
|
42
|
+
|
43
|
+
for(i=0;i<10;i++){
|
44
|
+
|
45
|
+
list[n]=i;/*-(2)*/
|
46
|
+
|
47
|
+
n++;
|
22
48
|
|
23
49
|
}
|
24
50
|
|
25
|
-
|
51
|
+
|
26
52
|
|
27
53
|
}
|
28
54
|
|
29
|
-
|
55
|
+
(1)の段階では、index[0]=?,index[1]=?,index[2]=?の状態。
|
30
56
|
|
31
|
-
|
57
|
+
(2)の段階では、list[0]=0,list[1]=1,list[2]=2というようにlistの中身が分かる。-(A)
|
32
58
|
|
33
|
-
|
59
|
+
プログラムの実行結果が、
|
34
60
|
|
35
|
-
|
61
|
+
index[0]=0
|
36
62
|
|
37
|
-
|
63
|
+
index[1]=1
|
38
64
|
|
39
|
-
n
|
65
|
+
index[2]=2
|
40
66
|
|
41
|
-
|
67
|
+
index[3]=3
|
42
68
|
|
43
|
-
|
69
|
+
index[4]=4
|
44
70
|
|
45
|
-
|
71
|
+
というようになりました。
|
46
72
|
|
47
|
-
|
73
|
+
なぜ、indexの中身が分かるようになったのか分かりません。
|
48
74
|
|
49
|
-
(2)の部分では、list[0]=0;list[1]=1;list[2]=2というようにlistの中身が分かる-(A)
|
50
|
-
|
51
|
-
|
75
|
+
(A)のときにindex[0]=0,index[1]=1;index[2]=2というようにindexの中身も分かるのでしょうか?どうかよろしくお願いします。
|
1
質問の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,6 +40,8 @@
|
|
40
40
|
|
41
41
|
}
|
42
42
|
|
43
|
+
}
|
44
|
+
|
43
45
|
------------------------------------------------------
|
44
46
|
|
45
47
|
(1)の部分では、index[0]=?index[1]=?index[2]=?index[3]=?の状態
|