Sign in to follow this  
Calin

Some C# questions

Recommended Posts

Calin    419
I started using C# and DirectX for a project. The first question is how do you organize your code in a C# project. The C++ logic doesn't work. You can't write the definition of a function outside the class, this makes the class quite messy after a while. Are there some unwritten rules to follow like those from C++ projects? My second question is about STL containers, I know you could use them in a C# application by adding a #pragma unmanaged statement, however I would like to ask if C# has some native containers similar to STL containers. My last question is if I start using C++ STL containers would it be possible to store Managed DirectX resources (i.e. meshes, textures) in them? Thanks in advance.

Share this post


Link to post
Share on other sites
Telastyn    3777
.NET container classes are called 'collections'. In .NET 2.0, List<T> and Dictionary<K,V> are the most similar to the STL containers.

Share this post


Link to post
Share on other sites
Telastyn    3777
I don't know. I don't read much of others' code, and don't have real life coders to banter such stuff with.

Personally, I like grouping all of the delegate definitions/enum declarations near the top, followed by data, followed by functions [grouped by similarity, in #regions for larger structures]. It's likely one of those things where there's a few different preferences, and the key is that you pick one and use it consistantly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this