Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# code to triple a number Pin
J4amieC8-May-08 2:22
J4amieC8-May-08 2:22 
GeneralRe: C# code to triple a number Pin
Christian Graus8-May-08 2:24
protectorChristian Graus8-May-08 2:24 
GeneralRe: C# code to triple a number Pin
Xmen Real 8-May-08 2:32
professional Xmen Real 8-May-08 2:32 
AnswerRe: C# code to triple a number Pin
Christian Graus8-May-08 2:24
protectorChristian Graus8-May-08 2:24 
GeneralRe: C# code to triple a number Pin
dan!sh 8-May-08 2:28
professional dan!sh 8-May-08 2:28 
AnswerRe: C# code to triple a number Pin
Pete O'Hanlon8-May-08 2:26
mvePete O'Hanlon8-May-08 2:26 
AnswerRe: C# code to triple a number Pin
#realJSOP8-May-08 2:50
professional#realJSOP8-May-08 2:50 
AnswerRe: C# code to triple a number Pin
BadKarma8-May-08 2:51
BadKarma8-May-08 2:51 
Hi,
You can use the following classes

public class Single
{
  private int _iValue;

  public int Value
  {
    get { return _iValue; }
  }

  public Single() : this(0) {}
  public Single(int iValue) 
  {
    _iValue = iValue;
  }
};

public class Double
{
  private int _iValue;

  public int Value
  {
    get 
    {
      Single sinA = new Single(_iValue);
      Single sinB = new Single(_iValue);
      
      return sinA.Value + sinB.Value; 
    }
  }

  public Double() : this(0) {}
  public Double(int iValue) 
  {
    _iValue = iValue;
  }
};

public class Tripple
{
  private int _iValue;

  public int Value
  {
    get
    {
      Double douA = new Double(_iValue);
      Single sinB = new Single(_iValue);

      return douA.Value + sinB.Value;
    }
  }

  public Tripple() : this(0) { }
  public Tripple(int iValue)
  {
    _iValue = iValue;
  }
};


You can use it like this;
Tripple tripNumber = new Tripple(5);
int iData = tripNumber.Value;


Learn from the mistakes of others, you may not live long enough to make them all yourself.

GeneralRe: C# code to triple a number Pin
J4amieC8-May-08 3:00
J4amieC8-May-08 3:00 
GeneralRe: C# code to triple a number Pin
BadKarma8-May-08 4:26
BadKarma8-May-08 4:26 
GeneralRe: C# code to triple a number Pin
J4amieC8-May-08 4:55
J4amieC8-May-08 4:55 
GeneralRe: C# code to triple a number Pin
BadKarma8-May-08 5:00
BadKarma8-May-08 5:00 
QuestionRe: C# code to triple a number Pin
CPallini8-May-08 3:20
mveCPallini8-May-08 3:20 
AnswerRe: C# code to triple a number Pin
Osten8-May-08 4:34
Osten8-May-08 4:34 
GeneralRe: C# code to triple a number Pin
laserbaronen8-May-08 4:36
laserbaronen8-May-08 4:36 
GeneralRe: C# code to triple a number Pin
Osten8-May-08 4:39
Osten8-May-08 4:39 
GeneralRe: C# code to triple a number Pin
laserbaronen8-May-08 4:41
laserbaronen8-May-08 4:41 
QuestionCMD.EXE from C# .net Pin
cristi_alonso8-May-08 1:34
cristi_alonso8-May-08 1:34 
AnswerRe: CMD.EXE from C# .net Pin
natsuyaki8-May-08 2:11
natsuyaki8-May-08 2:11 
QuestionmyProcess.StandardOutput Issue Pin
Harvey Saayman8-May-08 1:22
Harvey Saayman8-May-08 1:22 
AnswerRe: myProcess.StandardOutput Issue Pin
natsuyaki8-May-08 1:45
natsuyaki8-May-08 1:45 
QuestionPen Drive Pin
Bhim Prakash Singh8-May-08 0:53
Bhim Prakash Singh8-May-08 0:53 
AnswerRe: Pen Drive Pin
Christian Graus8-May-08 1:13
protectorChristian Graus8-May-08 1:13 
AnswerRe: Pen Drive Pin
Spunky Coder8-May-08 1:13
Spunky Coder8-May-08 1:13 
QuestionSending a E-mail in C# Pin
imnotso#8-May-08 0:21
imnotso#8-May-08 0:21 

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.