質問編集履歴

2

c++のタグを削除。

2024/01/03 09:24

投稿

varmosy
varmosy

スコア4

test CHANGED
File without changes
test CHANGED
File without changes

1

問題・わからないことの修正。ソースコードおよびエラーコードの修正。

2024/01/03 07:49

投稿

varmosy
varmosy

スコア4

test CHANGED
File without changes
test CHANGED
@@ -5,16 +5,22 @@
5
5
 
6
6
  ### 発生している問題・分からないこと
7
7
  自分では原因のわからないエラーコードが発生します。
8
+ なぜ下記のようなエラーコードがでるのか、またどうしたら直るのか、どのようにしたら上記のプログラムを実現できるのか教えてほしいです。
8
9
 
9
10
  ### エラーメッセージ
10
11
  ```error
11
12
  passing argument 2 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
13
+ passing argument 1 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
14
+ passing argument 2 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
15
+ passing argument 1 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
16
+ passing argument 1 of ‘swap’ from incompatible pointer type [-Wincompatible-pointer-types]
12
17
  ```
13
18
 
14
19
  ### 該当のソースコード
15
20
 
16
21
  ```
17
22
  #include <stdio.h>
23
+ #include <string.h>
18
24
 
19
25
  int moji(char p[], char q[])
20
26
  {