Reputation: 773
I'm a little confused.
In the code:
[DllImport("library.dll")]
public static extern void function(int x);
why is the x required? Shouldn't the int be enough as this is just a definition and not a declaration?
Upvotes: 1
Views: 178
Reputation: 223187
Its the C# Syntax, the same goes for methods in interface.
Probably the biggest reason is, that it adds clarity to the code. Parameter name may tells about the expected value in method
Upvotes: 3