Liste des Groupes | Revenir à cl c |
On 22/08/2024 08:01, Bart wrote:On 22/08/2024 09:41, Mark Summerfield wrote:
This is the type's struct:
typedef struct {
int _size;
int _cap;
char** _values;
} VecStr;
What's with the leading underscores for member names?
It means ending with ->_ later on, which seems pointless extra
clutter.
C++ is responsible for this.
C++ made the usage of 'this->' optional when calling member
functions.
As a result, when C++ programmers encounter 'i' in the middle of a
function, they might not know where it comes from.
If 'this->' were not optional, 'this->i' would clarify that.
To avoid confusion, many C++ programmers use prefixes like 'm_' that
can't be ignored.
Since many C programmers also work in C++, this pattern can sometimes
influence C code as well.
Les messages affichés proviennent d'usenet.