3 ms·
Eh? Says who? Every C programmer I've ever met knows about this. It's basic C.
by junon 5y ago
Eh? Says who? Every C programmer I've ever met knows about this. It's basic C.
- jart 5y agoYeah you have to do something like this if you want to truly raise eyebrows. /\ */ best c comment *\ /
- Zababa 5y agoOne trick that I like is replacing { and } with <% and %>.
- junon 5y agoWow, a new C trick I didn't know about. What's the history here? Also, gross.
- turminal 5y agoOn some ancient systems { and } don't exist. So an alternarive made of more common characters is provided. There is also a two-character combination for [ and ] and a three character combination for |, & and some other characters. The feature is called digraphs/trigraphs and is disabled on most modern compilers by default.
- junon 5y agoAh okay I knew about that whole thing, I didn't think C had so many of them.
- Zababa 5y ago> The feature is called digraphs/trigraphs and is disabled on most modern compilers by default. Digraphs and trigraphs are treated differently. <% and %> are fine on GGC and Clang, but ??< and ??> are disabled by default. Both need the -trigraphs option.