سؤال

I know there is no header files concept in C#. I created a header file with some definitions and structures for c++ project.

Now I need to develop the same project using C#, In C# how can we declare the contents of that header file. I need to use those header file contents for entire project in C#.

Thanks!!

هل كانت مفيدة؟

المحلول

As you're already noticed, there isn't a Header concept for C#. Stuff that you normally define in C++ headers is packed into normal class files (*.cs) in C#, e.g. enum and stuff. You'd better be creating an own class file for each class. Use Visual Studios Folders to separate the .cs files by concern. This will normally also be reflected in the namespaces. To Access classes from different namespaces, use the "using" keyword in C#.

HTH, alex

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top