Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

In Main function another function is there and to that
function if we pass string as parameter ,then that string
value is passed by value or reference type?

Answer Posted / sultan

parameters are passed byvalue unless defined to be passed
as ref,

try this
inside MAIN
{
string a = "a";
console.writeline(a);
foo(a);
console.writeline(a);
foo1(ref a);
console.writeline(a);
console.readkey();
}

foo(string a)
{
a="b";
}
foo1(ref string a)
{

}
}

result:
a
a
b

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you see a loop recorder?

811


Differentiate between dataset and datareader?

908


Explain the difference between private and shared assembly?

826


What do you understand by 'access specifiers' in C#?

851


How are Windows programs different from normal C-programs?

2135


Write a sample code to write the contents to text file in c#?

840


What are the value types in c#?

897


You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?

865


Why we use methods in c#?

887


What is asynccallback c#?

951


How do you access a constant field declared in a class?

848


What are the types of inheritance in c#?

909


What is the difference between inheritance and abstract class?

835


Why do we need indexers in c#?

851


What is yield keyword?

834