Answer Posted / priya
If you want to pass the value of the variable, use the
ByVal syntax. By passing the value of the variable instead
of a reference to the variable, any changes to the variable
made by code in the subroutine or function will not be
passed back to the main code. This is the default passing
mechanism when you don’t decorate the parameters by using
ByVal or ByRef.
If you want to change the value of the variable in the
subroutine or function and pass the revised value back to
the main code, use the ByRef syntax. This passes the
reference to the variable and allows its value to be
changed and passed back to the main code.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What Happens In Memory When You Box And Unbox A Value-type?
How do you determine whether a string represents a numeric value?
What is a datacontract?
what is IFormatable
What is a struct in C#?
Can you mark static constructor with access modifiers?
Is enum a value type c#?
What is the use of flag in c#?
what is the purpose of using statement in c#
Why is c# good for games?
Why c# is called type safe language?
What is the predicate of a sentence?
Define constructor in c#.
What is the main purpose of delegates in c#?
Is null c# operator?