This message was edited by lyubo at 2003-5-2 10:1:34
:
This message was edited by Rykon at 2003-5-2 9:51:26
: That is ok, I was giving an example in c++ and I was wonder the C# equiv. Might I add I need it to work with a static and an object.
:
:
:
I'll try to give an example of what I think you are trying to express (hopefully, if we are both lucky, i will not be wrong ;))
using System;
namespace MyTestSpace
// namespace
{
// simple SHOWOFF class
public class WhatACalculator
// class
{
// simple static method
public static int Add(int fNum,int lNum)
// method
{
// add the two values and return the result;
return fNum+lNum;
} // end method
static void Main()
{ // method
int myAge=18; // yes i'm 18
int myGirlFriendsAge=16; // no, my girlfriend's is not 16
int myMomsAge= // because my mom's age is 35

// calling the static add method, we don't need an object instance forIt
WhatACalculator.Add(myAge,myGirlFriendsAge);
// display the result from the Add method usage;
Console.WriteLine(myMomsAge.ToString());
} // end method
} // end class
} // end namespace