▲ | pwdisswordfishz 4 days ago | |
> A C argument declaration is made up of modifiers (register, const), a data type (char *), and a name (from). Now explain a declaration like "char *argv[]"... > We’ve also re-set the data type such that there is no space between char and * - the data type of both of these variables is “pointer to char”, so it makes more sense to put the space before the argument name, not in the middle the data type’s name (update: it should be pointed out that this only makes sense for a single declaration. A construct like char* a, b will create a pointer to char, a, and a regular char, b). Ah, yes, the delusional C++ formatting style. At least it's nice that the update provides the explanation why it should be avoided. | ||
▲ | yccs27 4 days ago | parent [-] | |
My $0.02: Don't throw away a perfectly good mental model because of a compiler ideosyncasy. Just treat it as a special case and use a linter against stuff like char* a, b. You also don't think about dollars differently than other units, just because the sign goes before the number. |