Links

Categories

Tags


« | Main | »

Declarations

By Jewe | October 29, 2012

// declare and define a class
class Foo
{
    method Foo()
    {
    }
}

// declare and define a function
function string main(const string[] args)
{
    // declare and define some variables
    int dec = 0033, hex = 0x21, oct = 0o41, bin = 0b10001;
    float f = 0.0016, g = 1.6e-3;
    string s = "hello";
    string[] a = { dec, hex, oct, bin, f, g, s };
    Foo foo = new Foo();
    return "";
}

// you may also:

// forward declare a class
class Bar;

// declare a class
class Bar
{
    method Bar();
}

// define a class
method Bar::Bar()
{
}

// forward declare a function
function int DoSomething(float, string);

Topics: code examples | Comments Off on Declarations

Comments are closed.