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