Click here to Skip to main content
15,888,968 members
Home / Discussions / C#
   

C#

 
GeneralRe: Data Grid View Pin
Michael Bookatz15-Jan-09 5:48
Michael Bookatz15-Jan-09 5:48 
GeneralRe: Data Grid View Pin
Douglas Troy15-Jan-09 8:36
Douglas Troy15-Jan-09 8:36 
QuestionHi adding data's to datatable, Pin
Hema Bairavan15-Jan-09 5:37
Hema Bairavan15-Jan-09 5:37 
GeneralRe: Hi adding data's to datatable, Pin
nelsonpaixao15-Jan-09 5:56
nelsonpaixao15-Jan-09 5:56 
GeneralRe: Hi adding data's to datatable, Pin
Hema Bairavan15-Jan-09 6:04
Hema Bairavan15-Jan-09 6:04 
GeneralRe: Hi adding data's to datatable, Pin
Henry Minute15-Jan-09 6:43
Henry Minute15-Jan-09 6:43 
GeneralRe: Hi adding data's to datatable, Pin
nelsonpaixao15-Jan-09 15:58
nelsonpaixao15-Jan-09 15:58 
QuestionPhilisophical question Pin
Gary Wheeler15-Jan-09 4:38
Gary Wheeler15-Jan-09 4:38 
There are two ways to initialize members in a C# class, via constructor:
class MyClass
{
  private int Member;
  public MyClass()
  {
    Member = 0;
  }
}
or through member initialization:
class MyClass
{
  private int Member = 0;
}
My question: Are there problems / benefits of one approach vs. another?

From what I can see, it's a wash if you only have a default constructor. If you have multiple constructors, member initialization is preferable for those members that are set to the same value by all constructors.

Software Zen: delete this;

AnswerRe: Philisophical question [modified] Pin
Douglas Troy15-Jan-09 5:03
Douglas Troy15-Jan-09 5:03 
GeneralRe: Philisophical question Pin
S. Senthil Kumar16-Jan-09 4:32
S. Senthil Kumar16-Jan-09 4:32 
AnswerRe: Philisophical question Pin
#realJSOP15-Jan-09 5:50
mve#realJSOP15-Jan-09 5:50 
AnswerRe: Philisophical question Pin
Scott Dorman15-Jan-09 5:51
professionalScott Dorman15-Jan-09 5:51 
GeneralRe: Philisophical question Pin
carbon_golem15-Jan-09 8:34
carbon_golem15-Jan-09 8:34 
GeneralRe: Philisophical question Pin
Scott Dorman15-Jan-09 8:39
professionalScott Dorman15-Jan-09 8:39 
GeneralRe: Philisophical question Pin
S. Senthil Kumar15-Jan-09 18:28
S. Senthil Kumar15-Jan-09 18:28 
GeneralRe: Philisophical question Pin
carbon_golem16-Jan-09 5:51
carbon_golem16-Jan-09 5:51 
GeneralRe: Philisophical question Pin
S. Senthil Kumar16-Jan-09 6:58
S. Senthil Kumar16-Jan-09 6:58 
GeneralRe: Philisophical question Pin
Gary Wheeler16-Jan-09 0:41
Gary Wheeler16-Jan-09 0:41 
GeneralRe: Philisophical question Pin
Scott Dorman16-Jan-09 3:41
professionalScott Dorman16-Jan-09 3:41 
AnswerRe: Philisophical question Pin
S. Senthil Kumar15-Jan-09 18:39
S. Senthil Kumar15-Jan-09 18:39 
AnswerRe: Philisophical question Pin
Vikram A Punathambekar15-Jan-09 22:03
Vikram A Punathambekar15-Jan-09 22:03 
GeneralRe: Philisophical question Pin
Gary Wheeler16-Jan-09 0:39
Gary Wheeler16-Jan-09 0:39 
GeneralRe: Philisophical question Pin
Vikram A Punathambekar16-Jan-09 1:47
Vikram A Punathambekar16-Jan-09 1:47 
GeneralRe: Philisophical question Pin
Gary Wheeler16-Jan-09 1:52
Gary Wheeler16-Jan-09 1:52 
QuestionSybase Binary Columns [modified] Pin
mobius11100115-Jan-09 4:25
mobius11100115-Jan-09 4:25 

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.