Code Fix

初級No overload for method の原因と直し方 › パターン2

No overload for method の原因と直し方

メソッドの引数の数や型が定義と一致しないときに出ます。

 1  class Program {
 2      static int Triple(int a, int b, int c) { return a + b + c; }
 3      static void Main(string[] args) {
 4          System.Console.WriteLine(Triple(1, 2______));
                                                   ^
 5      }
 6  }
Program.cs(4,34): error CS7036: There is no argument given that corresponds to the required parameter 'c' of 'Program.Triple(int, int, int)'

空欄を埋めてビルドを通す

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

No overload for method の原因と直し方

オーバーロード解決の仕組みを理解する入り口になります。

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

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