3 ms·
Reserved Words in C [pdf]
- mastermedo 4y agofriend!?
- booboofixer 4y agohttps://en.cppreference.com/w/cpp/language/friend https://en.cppreference.com/w/cpp/language/friend
- eesmith 4y agoUnder "Reserved words in C" is "(and C++)" making the HN title a bit misleading. "friend" is a C++ keyword but not one in C.
- pklausler 4y agoReserved words in Fortran and PL/1:
- anyfoo 4y agoTwo interesting ones that caught my eye: "entry". It was a keyword only in Pre-K&R C. I wonder what it did (and I don't have the time to dig just right now). "I". It's a "secondary" keyword (basically an alternative spelling of some other keyword according to the legend), but only since C11, but not in any C++ dialects. I wonder what it's an alternative spelling for. This one is hard to google, or even just search for in the spec...
- pklausler 4y agoI don't think that "entry" was ever implemented, but the intent was to support something like the ENTRY statement of Fortran.
- eesmith 4y agohttps://en.cppreference.com/w/c/numeric/complex/imaginary https://en.cppreference.com/w/c/numeric/complex/imaginary #include <complex.h> ... double imaginary i = -2.0*I; // pure imaginary double f = 1.0; // pure real double complex z = f + i; // complex number from gcc's complex.h: #ifdef __GNUC__ #if __STDC_VERSION__ < 199901 #define _Complex __complex__ #endif #define _Complex_I ((float _Complex)1.0i) #endif #ifdef __generic _Static_assert(__generic(_Complex_I, float _Complex, 1, 0), "_Complex_I must be of type float _Complex"); #endif #define complex _Complex #define I _Complex_I
- anyfoo 4y agoAh. I even entertained the fact that it may be for complex numbers, but... honestly didn't know C added support for that! This despite using complex numbers a lot, just not in C so far. I always assumed I would have to use an external library.