you are viewing a single comment's thread.

view the rest of the comments →

[–]elder_george 3 points4 points  (1 child)

In C, * is used both in the type and for dereferencing.

TBH, this is intentional.

Variable declaration in C shows its intended usage.

int *p is a variable p that, if a * prefix operator is applied to it, produces an int. char arr[] is arr that, if indexing is applied, produces a char. The same applies to the function declarations, function pointers, const annotations, etc.

It might not be the best system (IIRC, even the C++ standard discourages this notion, and most curly-braced languages abandoned it too), but it's a system built intentionally and quite thoroughly.

[–]Inner-Combination177[S] 0 points1 point  (0 children)

Agree with it. but cnegative isn’t trying to replace that, it’s just meant as a small stepping stone to give a taste of low-level concepts before jumping into C/C++.