Click here to Skip to main content
15,914,452 members
Home / Discussions / C#
   

C#

 
Questioncan i use optional parameters Pin
Sonia Gupta6-Aug-07 19:38
Sonia Gupta6-Aug-07 19:38 
AnswerRe: can i use optional parameters Pin
Hessam Jalali6-Aug-07 20:19
Hessam Jalali6-Aug-07 20:19 
AnswerRe: can i use optional parameters [modified] Pin
Tormod Fjeldskaar6-Aug-07 20:25
Tormod Fjeldskaar6-Aug-07 20:25 
GeneralRe: can i use optional parameters Pin
Sonia Gupta6-Aug-07 20:55
Sonia Gupta6-Aug-07 20:55 
GeneralRe: can i use optional parameters Pin
Christian Graus6-Aug-07 21:01
protectorChristian Graus6-Aug-07 21:01 
GeneralRe: can i use optional parameters Pin
Sonia Gupta6-Aug-07 21:10
Sonia Gupta6-Aug-07 21:10 
AnswerRe: can i use optional parameters Pin
Diana Fernandez6-Aug-07 21:12
Diana Fernandez6-Aug-07 21:12 
AnswerRe: can i use optional parameters Pin
Pete O'Hanlon6-Aug-07 21:47
mvePete O'Hanlon6-Aug-07 21:47 
One way to do this, is to use the params keyword. The only problem is that you have no control over what the developer puts in, but this is how things like string.Format work. Example:
public void DoSomething(params string[] items)
{
  if (items != null && items.Length > 0)
  {
    foreach (string item in item)
    {
      // Do something.
    }
  }
}


Deja View - the feeling that you've seen this post before.

QuestionString to stream [modified] Pin
mpavas6-Aug-07 19:35
mpavas6-Aug-07 19:35 
AnswerRe: String to stream Pin
Hessam Jalali6-Aug-07 20:08
Hessam Jalali6-Aug-07 20:08 
Questiongoto in c# Pin
Sonia Gupta6-Aug-07 19:18
Sonia Gupta6-Aug-07 19:18 
AnswerRe: goto in c# Pin
Christian Graus6-Aug-07 19:22
protectorChristian Graus6-Aug-07 19:22 
GeneralRe: goto in c# Pin
Sonia Gupta6-Aug-07 19:25
Sonia Gupta6-Aug-07 19:25 
QuestionRe: goto in c# Pin
Urs Enzler6-Aug-07 23:18
Urs Enzler6-Aug-07 23:18 
QuestionSending parameters to method by reference ... ? Pin
Yanshof6-Aug-07 19:18
Yanshof6-Aug-07 19:18 
AnswerRe: Sending parameters to method by reference ... ? Pin
Hessam Jalali6-Aug-07 20:26
Hessam Jalali6-Aug-07 20:26 
AnswerRe: Sending parameters to method by reference ... ? Pin
Luc Pattyn7-Aug-07 2:12
sitebuilderLuc Pattyn7-Aug-07 2:12 
QuestionMedia Pin
sulabh20206-Aug-07 18:52
sulabh20206-Aug-07 18:52 
AnswerRe: Media Pin
Ravi Bhavnani6-Aug-07 18:59
professionalRavi Bhavnani6-Aug-07 18:59 
GeneralRe: Media Pin
sulabh20206-Aug-07 19:06
sulabh20206-Aug-07 19:06 
Questionincrementing the array and preserving the values after incrementation Pin
Sonia Gupta6-Aug-07 18:38
Sonia Gupta6-Aug-07 18:38 
AnswerRe: incrementing the array and preserving the values after incrementation Pin
Ravi Bhavnani6-Aug-07 18:57
professionalRavi Bhavnani6-Aug-07 18:57 
GeneralRe: incrementing the array and preserving the values after incrementation Pin
Sonia Gupta6-Aug-07 18:59
Sonia Gupta6-Aug-07 18:59 
AnswerRe: incrementing the array and preserving the values after incrementation Pin
Guffa6-Aug-07 19:02
Guffa6-Aug-07 19:02 
GeneralRe: incrementing the array and preserving the values after incrementation Pin
Sonia Gupta6-Aug-07 19:39
Sonia Gupta6-Aug-07 19:39 

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.