初級 › No overload for method の原因と直し方 › パターン5
No overload for method の原因と直し方
メソッドの引数の数や型が定義と一致しないときに出ます。
1 class Program { 2 static double Avg(double a, double b, double c) { return (a + b + c) / 3; } 3 static void Main(string[] args) { 4 System.Console.WriteLine(Avg(1, 2______)); ^ 5 } 6 }
Program.cs(4,34): error CS7036: There is no argument given that corresponds to the required parameter 'c' of 'Program.Avg(double, double, double)'
空欄を埋めてビルドを通す
Avgは3つの引数が必須です。1つ足りないとその個数向けのオーバーロードが見つかりません。
次の問題