Depends on what you want to achieve. If you want to be able to drop the anint
parameter, you have to create an overload:
public void myMethod(string astring, int anint)
{
}
public void myMethod(string astring)
{
myMethod(astring, 0); // or some other default value for anint
}
You can now do:
myMethod("boo"); // equivalent to myMethod("boo", 0);
myMethod("boo", 12);
If you want to pass a nullable int, well, see the other answers. ;)