Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は少し混乱しています。
コード内:
[DllImport("library.dll")] public static extern void function(int x);
なぜ x が必要なのですか? これは単なる定義であり、宣言ではないため、int で十分ではないでしょうか?
そのC#構文は、同じことがインターフェイスのメソッドにも当てはまります。
おそらく最大の理由は、コードを明確にするためです。パラメータ名は、メソッドの期待値を伝える場合があります