Howto: Forward declarations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Silly question but I haven't found the syntax yet. How do I forward declare
a class type in C#?
 
You don't...in general you don't need to. What are you trying to achieve?
 
I would like to reference a class defined lower down in the code within the
same namespace. I can get around it by moving the class definition up but I
prefer to keep my main class/code at the top of the file with helper/support
definitions at the bottom. Old habits y'know...
 
Nevermind, I had another problem that prevented the compiler from seeing the
class definition.
 
Back
Top