2

Possible Duplicate:
Is there a way to omit out parameter?

Instead of:

SomeType param3;
SomeMethodCall(param1, param2, out param3);

I want not to define param3 in the case I don't need its value.

Is there any way to achieve this?

Community
  • 1
  • 1
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266

3 Answers3

1

No, there is no way of doing that in C#.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
1

If SomeMethodCall is something you defined yourself then you can overload the method. If it's not then you can't.

Jan-Peter Vos
  • 3,157
  • 1
  • 18
  • 21
0

No, you'll have to actually create a variable of the correct type if you want to use a function that takes an out parameter.

Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249