Code Fix

初級E0061: this function takes N arguments but M were supplied の原因と直し方 › パターン3

E0061: this function takes N arguments but M were supplied の原因と直し方

関数が定義している数と異なる数の引数を渡すと、コンパイル時にE0061エラーになります。

 1  fn multiply(a: i32, b: i32, c: i32) -> i32 {
 2      a * b * c
 3  }
 4  
 5  fn main() {
 6      println!("{}", multiply(_______));
                                   ^
 7  }
error[E0061]: this function takes 3 arguments but 2 arguments were supplied

空欄を埋めて実行を通す

広告
広告スロット(未設定)

E0061: this function takes N arguments but M were supplied の原因と直し方

引数を1つ多く渡した、あるいは渡し忘れたことが典型的な原因です。

このエラーの解説と類題をまとめて見る →

広告
広告スロット(未設定)