.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it?

Posted By :nishithraj     Posted Date :November 30, 2009    Points :10   Category :C# 
You should declare the variable as an int, but when you pass it in you must specify it as 'out', like the following: int i; foo(out i); where foo is declared as follows: [return-type] foo(out int o) { }

You can also find related Interview Question to I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it?  below: 

What are the different parameter passing techniques c# supports?

byvalue (default),byreference,out and paramarray (More...)

Is it Possible to declare an array variable without initialization?

Yes. It is possible .Use "New" keyword.
int[] myArray;
myArray = new int[] {1,3,5,7,9}; (More...)

I thought destructors didn't exist in C#.Why can I declare one?

You can declare a method that looks like a C++ destructor such as ~Employee(). But it really becomes a shorthand way to define System.Object.Finalize.The Finalize method is not the same as a C++ destructor.A short explanation is that C++ destructors are called when the call stack unwinds.The Finalize method will be called when the garbage collector of the CLR is ready to destroy the object. (More...)

How to remove a Session variable?

using HttpSessionState.Remove(); (More...)

When do you have to declare a class as abstract?

1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
2. When at least one of the methods in the class is abstract. (More...)

Can you declare an override method to be static if the original method is not static?

No. The signature of the virtual method must remain the same.
(Note: Only the keyword virtual is changed to keyword override). (More...)

Is it possible to set SessionState to readonly mode? Readonly mode means, we can only read data from session but we can not write any data in session variable?

Yes, it is possible.
EnableSessionState property has a value "Readonly" which actually makes the session state read only.

Thanks. (More...)

Can we pass more than one querystring parameter with hyperlink in .aspx file?

Yes we can.
Code can be like,
NavigateUrl='<%# "Page.aspx?param1=" & _
DataBinder.Eval(Container.DataItem, "param1") & _
"¶m2=" & DataBinder.Eval(Container.DataItem, "param2") %>'
Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend