Weird Symbols in C

Isshiki🐈
2 min readAug 12, 2020

--

You’re probably wondering what possible reason there could be for re-using the static keyword with these wildly different meanings. If you find out, please let us know, too.

by Peter van der Linden

I have written quite a few posts talking about how C has reused some of its most important symbols and why reusing these symbols may confuse people, and it turns out I’m not alone (I’m not surprised though). In the famous Expert C Programming: Deep C Secrets, the author, Peter van der Linden, lists all of the symbols that can have different meanings when used in different contexts. (Table 2–1)

Part of Table 2–1

To make things even worse, C programmers have this convention to declare a pointer like int *ptr; intentionally mixing up two different concept (and K&R says it’s intended as an analogy) and if you continue to learn C++, you may even come across declarations like int &ref; These conventions sure work best with the syntax of C, and you can sure get used to them, but they definitely make learning these concepts much much harder. Alternatively, you may choose to declare a pointer in the C++ style (as pointed out by the creator of the language, Bjarne Stroustrup), like int* ptr; which tells you clearly that int* is a type and you are declaring a pointer. There is nothing wrong with this style, of course, and after you get used to pointers, you may choose the C style if you like.

--

--

Isshiki🐈
Isshiki🐈

No responses yet