Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBlack-Rook

Posted 16 October 2012 - 11:44 PM

C# uses functions like C++ does. Since C# uses classes, you have functions in those classes.

For example:

using System;

class Ball
{
    private int x, y;
	
	 // Constructor
	public Ball(int Temp_X, int Temp_Y)
	{
		x = Temp_X;
		y = Temp_Y;
	}

	// Destructor
	~Ball(){}

	// Get X
	public int Get_X()
	{
		return x;
	}
}

Just a basic example.

#1Black-Rook

Posted 16 October 2012 - 11:41 PM

C# uses functions like C++ does. Since C# uses classes, you have functions in those classes.

For example:

using System;

class Ball
{
	int x, y;
	
	 // Constructor
	public Ball(int Temp_X, int Temp_Y)
	{
		x = Temp_X;
		y = Temp_Y;
	}

	// Destructor
	~Ball(){}

	// Get X
	public int Get_X()
	{
		return x;
	}
}

Just a basic example.

PARTNERS