View Single Post
  #3 (permalink)  
Old 08-06-2007, 12:02 PM
Bench Bench is offline
Full Programmer
Join Date: Jul 2007
Location: UK
Posts: 113
iTrader: (0)
Bench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished road
Quote:
Originally Posted by TeraTask View Post
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)

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by Bench : 08-06-2007 at 12:07 PM.
Reply With Quote
The Following User Says Thank You to Bench For This Useful Post:
TeraTask (08-06-2007)