If a class is a ref type, how we can pass to a function.

Answer Posted / sujai cn

We can pass the object to a function by pass by reference
type.
create an object and pass that object to the function.
when we pass the object to function a copy constructor is
used to create a bit wise copy of the object sent to the
function.If there is no copy constructor implemented the
default copy constructor is called.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is asp net in c#?

714


What is difference between ienumerable and iqueryable in c#?

703


How long will it take to learn c sharp?

705


What is marshalling in c#?

651


Explain why do I get an error (cs1006) when trying to declare a method without specifying a return type?

642


What are the fundamental principles of oo programming?

795


What is the difference between an application domain and a process?

694


Can we have two main methods in c#?

722


Why do we need structs in c#?

617


What is icomparer in c#?

690


What is overloading in c#?

676


How do I move from one form to another in c#?

644


What is the difference between “finalize” and “finally” methods in c#?

696


If the original method is not static you can declare an override method to be static or not?

698


What is serialization in unity?

671