Quote:
Originally Posted by TeraTask I don't understand your question. Your code is interesting though as new DChat is called within DChat itself, thereby creating a recursive call? How did you create this? What kind of app did you choose when you created it?
I'm rather new to C# too.  |
I don't do much C# but..
a static function inside a class doesn't belong to objects created of that class, but to the class itself (Where a class is like a cookie-cutter for objects. Many instances/objects of the class can exist, but the class itself only exists once).
in a way, a static function is like a global function, which exists once and only once for the lifetime of the entire program.
In fact, a class can create objects of itself at any time. Although a constructor should be careful in creating objects of its own class, since there is the potential for an infinite loop there (an object's constructor calling an object's constructor calling an object's constructor.. etc)
As to the original error message, I think C# does an unusual thing of capitalising the first letter of
Main() - your main() is a lowercase 'm' (as per C/C++/Java)