Writing name in C, C++

Here are some definitions of class, struct and union.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

class CFoo
{
   // CFoo is a CLASS defined by using 'class' keyword
};

struct SFoo
{
   // SFoo is a CLAunion UFoo
{

union UFoo
{
   // UFoo is a CLASS defined by using 'union' keyword
};


As you can see, the name of "CFoo", "SFoo", "UFoo" are started by the letter "C", "S" and "U" respectively.
I guess they are short for "Class", "Struct" and "Union".
What is the purpose of writing a name like that? Is it just easy to remember?
Last edited on
There is no logic in the naming (and the comments have Ctrl+R mistakes). The names were simply chosen at random because they were different from each other.
I tend to agree the naming convention was used to indicate they were class struct and union, respectively. Really, only the author know for sure.

Perhaps they were named that way as a nod to Hungarian notation (see the AppsHungarian section).
http://en.wikipedia.org/wiki/Hungarian_notation

As noted in the article, Hungarian notation is generally regarded as an impediment with modern type checking compilers.
Topic archived. No new replies allowed.