Is there a general practice when it comes to how to organize your classes in C#? Should there only be one generic class per .cs file? I see that I have Form1.cs which includes all of the classes relevant to "Form1". However I could create a file named Misc.cs which includes all misc classes. Not sure which way to go so everything stays organized.
Or should I organize them a specific way? For example, I am accessing a MySQL database, so i'm creating a MySQL wrapper which I will store in MysqlWrapper.cs and name the class to match it. Should I create a new .cs for each class I create?
Or should I combine only the ones that use similar "using" namespaces such as System.Text; using System.Windows.Forms; etc?
Writing to a file (fprintf or fputs)
A FILE is a type of structure typedef as FILE. It is considered as opaque data type as its implementation is hidden. We don't know what constitutes the type, we only use pointer to the type and library knows the internal of the type and can use the data. Definition of FILE is in stdio although it is system specific.
Edit - this answer is meant to supplement the good answers that others have already posted.
Everyone else seems to be answering specifics. I'm thinking you're going to have more "best practices" design questions.
The official guidelines can be found here: http://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx
In particular, dig into the Naming guidelines, and then into the Namespace Naming guidelines and Class Naming guidelines.
And, as others have mentioned, please, one class per file. It makes things easier on the poor maintenance developer who will follow you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With