Raj said:
While invoking a function using ref, where the actual and formal parameters
loaded in stack or heap?
See Christoph's reply, as well as Jon's article for description of
exceptions.
That said, you should not care at all whether the data is stored on the
stack or heap. That's an implementation detail and, while unlikely to
change, is not at all required to stay the same for future versions of
C#/.NET.
One of the points of writing "managed code" is to distance yourself from
these kinds of implementation details. If you are concerned about them,
there's a good chance they are interfering with good design of your code.
Pete