質問編集履歴

2

追記

2020/09/16 04:12

投稿

Domyyyy
Domyyyy

スコア4

test CHANGED
File without changes
test CHANGED
@@ -24,13 +24,13 @@
24
24
 
25
25
  CalcDay.h
26
26
 
27
- int Days(int nBDay[3],int nYMD[3]);//ヘッダファアイルではこのような定義をしました。
27
+ int Day(int nBDay[3],int nYMD[3]);//ヘッダファアイルではこのような定義をしました。
28
28
 
29
29
 
30
30
 
31
31
  CalcDay.cpp
32
32
 
33
- int Daze(int nBDay[3],int nYMD[3]){
33
+ int Day(int nBDay[3],int nYMD[3]){
34
34
 
35
35
  //処理
36
36
 
@@ -66,7 +66,7 @@
66
66
 
67
67
  main.cpp:52:23: error: invalid conversion from 'int' to 'int*' [-fpermissive]
68
68
 
69
- 52 | Daze(nBDay[3],nYMD[3]);
69
+ 52 | Day(nBDay[3],nYMD[3]);
70
70
 
71
71
  | ~~~~~~~^
72
72
 
@@ -76,15 +76,15 @@
76
76
 
77
77
  In file included from main.cpp:1:
78
78
 
79
- CalcDay.h:25:14: note: initializing argument 1 of 'int Daze(int*, int*)'
79
+ CalcDay.h:25:14: note: initializing argument 1 of 'int Day(int*, int*)'
80
80
 
81
- 25 | int Daze(int nBDay[3],int nYMD[3]);
81
+ 25 | int Day(int nBDay[3],int nYMD[3]);
82
82
 
83
83
  | ~~~~^~~~~~~~
84
84
 
85
85
  main.cpp:52:31: error: invalid conversion from 'int' to 'int*' [-fpermissive]
86
86
 
87
- 52 | Daze(nBDay[3],nYMD[3]);
87
+ 52 | Day(nBDay[3],nYMD[3]);
88
88
 
89
89
  |      ~~~~~~~^
90
90
 
@@ -94,9 +94,9 @@
94
94
 
95
95
  In file included from main.cpp:1:
96
96
 
97
- CalcDay.h:25:27: note: initializing argument 2 of 'int Daze(int*, int*)'
97
+ CalcDay.h:25:27: note: initializing argument 2 of 'int Day(int*, int*)'
98
98
 
99
- 25 | int Daze(int nBDay[3],int nYMD[3]);
99
+ 25 | int Day(int nBDay[3],int nYMD[3]);
100
100
 
101
101
  | ~~~~^~~~~~~
102
102
 

1

追記

2020/09/16 04:12

投稿

Domyyyy
Domyyyy

スコア4

test CHANGED
File without changes
test CHANGED
@@ -4,23 +4,7 @@
4
4
 
5
5
  どうしたら別のファイルに引数を渡し、実行できるようになりますか?教えてください。
6
6
 
7
- ```error
8
7
 
9
- main.cpp: In function 'void display()':
10
-
11
- main.cpp:52:16: error: expected primary-expression before 'int'
12
-
13
- 52 | Day(int nBDay[3],int nYMD[3]);
14
-
15
- | ^~~
16
-
17
- main.cpp:52:29: error: expected primary-expression before 'int'
18
-
19
- 52 | Day(int nBDay[3],int nYMD[3]);
20
-
21
- | ^~~
22
-
23
- ```
24
8
 
25
9
  ```
26
10
 
@@ -53,3 +37,69 @@
53
37
  }
54
38
 
55
39
  ```
40
+
41
+ これをコンパイルすると以下のエラー文になります。
42
+
43
+ ```error
44
+
45
+ main.cpp: In function 'void display()':
46
+
47
+ main.cpp:52:16: error: expected primary-expression before 'int'
48
+
49
+ 52 | Day(int nBDay[3],int nYMD[3]);
50
+
51
+ | ^~~
52
+
53
+ main.cpp:52:29: error: expected primary-expression before 'int'
54
+
55
+ 52 | Day(int nBDay[3],int nYMD[3]);
56
+
57
+ | ^~~
58
+
59
+ ```
60
+
61
+ うえのエラーコードの通りにintを外し、コンパイルすると
62
+
63
+
64
+
65
+ ```ここに言語を入力
66
+
67
+ main.cpp:52:23: error: invalid conversion from 'int' to 'int*' [-fpermissive]
68
+
69
+ 52 | Daze(nBDay[3],nYMD[3]);
70
+
71
+ | ~~~~~~~^
72
+
73
+ | |
74
+
75
+ | int
76
+
77
+ In file included from main.cpp:1:
78
+
79
+ CalcDay.h:25:14: note: initializing argument 1 of 'int Daze(int*, int*)'
80
+
81
+ 25 | int Daze(int nBDay[3],int nYMD[3]);
82
+
83
+ | ~~~~^~~~~~~~
84
+
85
+ main.cpp:52:31: error: invalid conversion from 'int' to 'int*' [-fpermissive]
86
+
87
+ 52 | Daze(nBDay[3],nYMD[3]);
88
+
89
+ |      ~~~~~~~^
90
+
91
+ | |
92
+
93
+ | int
94
+
95
+ In file included from main.cpp:1:
96
+
97
+ CalcDay.h:25:27: note: initializing argument 2 of 'int Daze(int*, int*)'
98
+
99
+ 25 | int Daze(int nBDay[3],int nYMD[3]);
100
+
101
+ | ~~~~^~~~~~~
102
+
103
+ ```
104
+
105
+ というエラー文が出てきて来てしまいます。