初級 › 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)'
空欄を埋めてビルドを通す
Tripleは3つの引数が必須です。1つ足りないとその個数向けのオーバーロードがないと判断されます。
次の問題