Click here to Skip to main content
15,919,132 members
Home / Discussions / C#
   

C#

 
QuestionChild Node Text ????????????? Pin
sajid.salim.khan15-Dec-06 20:36
sajid.salim.khan15-Dec-06 20:36 
AnswerRe: Child Node Text ????????????? Pin
Stefan Troschuetz15-Dec-06 21:11
Stefan Troschuetz15-Dec-06 21:11 
QuestionAccess Active Document In Word Template Project Pin
AmitSumit15-Dec-06 20:28
AmitSumit15-Dec-06 20:28 
Questioncode of remember me!!! Pin
Ashish Porwal15-Dec-06 20:12
Ashish Porwal15-Dec-06 20:12 
AnswerRe: code of remember me!!! Pin
toxcct22-Jan-07 10:28
toxcct22-Jan-07 10:28 
QuestionTriggers on sqlserver Pin
vikram92915-Dec-06 19:24
vikram92915-Dec-06 19:24 
QuestionPassing a collection object to a method as a ref parameter... or not? Pin
lvanerstrom15-Dec-06 17:44
lvanerstrom15-Dec-06 17:44 
AnswerRe: Passing a collection object to a method as a ref parameter... or not? Pin
Guffa15-Dec-06 18:27
Guffa15-Dec-06 18:27 
Don't use ref unless you need it.

You only need the ref keyword if you want to change the actual variable that is used to call the method, not just the contents of the variable. Here is an example of when you would need the ref keyword:

private static void CreateList(ref ArrayList list) {
   list = new ArrayList();
}

However, there is almost never any real need for the ref keyword. It's mostly used in procedural programming, seldom in object oriented programming.

The method that creates a list can be written like this, which will also make it clearer:

private static ArrayList CreateList() {
   return new ArrayList();
}




---
It's amazing to see how much work some people will go through just to avoid a little bit of work.

GeneralRe: Passing a collection object to a method as a ref parameter... or not? Pin
lvanerstrom15-Dec-06 18:34
lvanerstrom15-Dec-06 18:34 
QuestionAnybody know how to upload video using ASP.NET? Pin
mujin0315-Dec-06 17:12
mujin0315-Dec-06 17:12 
AnswerRe: Anybody know how to upload video using ASP.NET? Pin
Alper Camel17-Dec-06 9:04
Alper Camel17-Dec-06 9:04 
QuestionGetting dynamic Datagrid Pin
narendrakumarp15-Dec-06 16:39
narendrakumarp15-Dec-06 16:39 
QuestionNewbie problems Pin
new to this15-Dec-06 15:10
new to this15-Dec-06 15:10 
AnswerRe: Newbie problems Pin
Guffa15-Dec-06 17:08
Guffa15-Dec-06 17:08 
QuestionCreating an own Rectangle class Pin
babbelfisken15-Dec-06 13:30
babbelfisken15-Dec-06 13:30 
AnswerRe: Creating an own Rectangle class Pin
Guffa15-Dec-06 15:58
Guffa15-Dec-06 15:58 
AnswerRe: Creating an own Rectangle class Pin
CPallini15-Dec-06 22:29
mveCPallini15-Dec-06 22:29 
Questionpersistant variable? Pin
amatbrewer15-Dec-06 13:12
amatbrewer15-Dec-06 13:12 
AnswerRe: persistant variable? Pin
Guffa15-Dec-06 17:20
Guffa15-Dec-06 17:20 
JokeRe: persistant variable? Pin
amatbrewer18-Dec-06 5:24
amatbrewer18-Dec-06 5:24 
AnswerRe: persistant variable? Pin
Luc Pattyn15-Dec-06 18:47
sitebuilderLuc Pattyn15-Dec-06 18:47 
GeneralRe: persistant variable? Pin
Guffa15-Dec-06 19:20
Guffa15-Dec-06 19:20 
GeneralRe: persistant variable? Pin
Luc Pattyn16-Dec-06 4:35
sitebuilderLuc Pattyn16-Dec-06 4:35 
GeneralRe: persistant variable? Pin
Guffa16-Dec-06 16:04
Guffa16-Dec-06 16:04 
QuestionRegex Help Pin
Expert Coming15-Dec-06 11:52
Expert Coming15-Dec-06 11:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.