Click here to Skip to main content
14,332,889 members
   

C#

 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak3-Jun-19 2:37
mveDave Kreskowiak3-Jun-19 2:37 
GeneralRe: My thoughts on C# Pin
Brian_TheLion3-Jun-19 12:22
memberBrian_TheLion3-Jun-19 12:22 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 15:17
memberBrian_TheLion2-Jun-19 15:17 
GeneralRe: My thoughts on C# Pin
BillWoodruff1-Jun-19 17:40
mveBillWoodruff1-Jun-19 17:40 
GeneralRe: My thoughts on C# Pin
Brian_TheLion1-Jun-19 18:02
memberBrian_TheLion1-Jun-19 18:02 
GeneralRe: My thoughts on C# Pin
OriginalGriff1-Jun-19 20:16
protectorOriginalGriff1-Jun-19 20:16 
GeneralRe: My thoughts on C# Pin
Brian_TheLion1-Jun-19 20:37
memberBrian_TheLion1-Jun-19 20:37 
GeneralRe: My thoughts on C# Pin
phil.o1-Jun-19 22:02
mvephil.o1-Jun-19 22:02 
class A
{
   private B _b = new B();

   public int GetValue()
   {
      return (_b.BoolValue) ? 1 : 0;
   }

   public void SetValue(int input)
   {
      _b.BoolValue = (input != 0);
   }
}

class B
{
   public bool BoolValue
   {
      get; set;
   }
}

class Program{
   static Main(string[] args)
   {
      A a = new A();
      Console.WriteLine(a.GetValue()); // prints "0"
      a.SetValue(42);
      Console.WriteLine(a.GetValue()); // prints "1"
   }
}

I cannot imagine you had a look at C# without having to instantiate any class at least once. Maybe because you tried to copy some existing code which was not written with OOP in mind? You should take it from the ground, and follow some basic tutorials about C# and OOP not directly related to your task; this way you may get some important concepts that you will apply later to your actual case.
noop()

GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 16:16
memberBrian_TheLion2-Jun-19 16:16 
GeneralRe: My thoughts on C# Pin
OriginalGriff1-Jun-19 22:47
protectorOriginalGriff1-Jun-19 22:47 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 15:45
memberBrian_TheLion2-Jun-19 15:45 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak2-Jun-19 6:10
mveDave Kreskowiak2-Jun-19 6:10 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 15:32
memberBrian_TheLion2-Jun-19 15:32 
GeneralRe: My thoughts on C# Pin
Brian_TheLion3-Jun-19 12:49
memberBrian_TheLion3-Jun-19 12:49 
GeneralRe: My thoughts on C# Pin
BillWoodruff2-Jun-19 20:07
mveBillWoodruff2-Jun-19 20:07 
GeneralRe: My thoughts on C# Pin
Brian_TheLion3-Jun-19 12:40
memberBrian_TheLion3-Jun-19 12:40 
GeneralRe: My thoughts on C# Pin
Richard MacCutchan1-Jun-19 21:46
protectorRichard MacCutchan1-Jun-19 21:46 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 0:15
memberBrian_TheLion2-Jun-19 0:15 
GeneralRe: My thoughts on C# Pin
Mycroft Holmes2-Jun-19 13:36
memberMycroft Holmes2-Jun-19 13:36 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 15:22
memberBrian_TheLion2-Jun-19 15:22 
GeneralRe: My thoughts on C# Pin
Mycroft Holmes2-Jun-19 15:58
memberMycroft Holmes2-Jun-19 15:58 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 16:50
memberBrian_TheLion2-Jun-19 16:50 
GeneralRe: My thoughts on C# Pin
jsc423-Jun-19 23:18
professionaljsc423-Jun-19 23:18 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 17:48
memberBrian_TheLion4-Jun-19 17:48 
GeneralRe: My thoughts on C# Pin
Brian_TheLion3-Jun-19 12:32
memberBrian_TheLion3-Jun-19 12:32 

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.