In plain C, I will name a struct
like this:
struct MyStruct
{
int something;
};
But, since I'm now programming under Windows, I want my code to be very consistent in which refers to naming conventions. So, my variables are now named using mixedCase
instead of lower_case
and my functions are now using CapWords
. I have seen some structs with all capital letters, but I don't like this very much because I reserve that for constants and macros.
Thanks.
Check out this link if you want a reference on Naming Conventions in C.
As long as you're consistent with using CamelCase of under_score conventions for whatever purpose, it doesn't really matter.
What are the most common naming conventions in C?
Here is a similar question:
Naming convention for Win32/MFC with C++
MSDN naming guideline locates at http://msdn.microsoft.com/en-us/library/ms229002(v=vs.110).aspx
Struct naming convention is described at http://msdn.microsoft.com/en-us/library/ms229040(v=vs.110).aspx
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