Download MetaTrader 5

Wondering about class names?

To add comments, please log in or register
What are the latest MQL5.community news? The Wall section will tell you!
compojoom
32
compojoom 2016.06.09 09:58 

I got a book about programing EA. In the examples most of the created classes are prefixed with a C. CTrade, CTimer etc. I thought that this is a convention the author of the book decided to use for his book, but when I browsed the Include folder I see that most of the classes are names with a C. CObject, CString.

What does the C stand for in the class name?

Drazen Penic
2543
Drazen Penic 2016.06.09 11:09  

You are right. It's just a convention.

There is no real requirement to start a class name with "C", but Metaquotes' developers decided to prefix all class names with a "C" to make it easier to differentiate class names (types) from variable names.

compojoom
32
compojoom 2016.06.09 13:11  
Ah, ok. So C standard for Class?
Ex Ovo Omnia
3151
Ex Ovo Omnia 2016.06.09 14:09  
compojoom:
Ah, ok. So C standard for Class?

Very probably. There are multiple conventions (or standards) in naming classes, members, variables, methods and formatting sources. It was very useful in team development to keep uniformity. Your private code has no such requirements.

To add comments, please log in or register