refraining from a lot of election joke posting and instead I just donated $55 USD to gaza soup kitchen and i encourage anyone else to consider donating even a couple of dollars to the people who will be affected the most from whatever outcome happens
you can also donate to care for gaza here
EDIT: please also consider donating to this family their 93% to their goal!! and also please check out this post featuring more places to donate
Given the following declaration and initialization:
auto x = 'a';
what is the type of x?
x is a char
x is a short
x is an int
x is a long
x is something else
this won't compile because auto isn't a C keyword
this won't compile for some other reason
(see results)
Remaining time: 5 days 7 hours
There are two correct answers here:
Under C99, C11, and C17 (GCC/Clang flags "-std=c99", "-std=c11", or "-std=c17"), the answer is "this won't compile for some other reason".
Under C89, C95, and C23 (GCC/Clang flags "-std=c89", "-std=iso9899:199409", and "-std=c23"), the answer is int.
Why? A few reasons:
auto is, in fact, a keyword. It has been since C89, and since K&R before that, and since B before that. It is a storage-class specifier (like static or thread_local or constexpr) and means "automatic storage duration"; AKA "this variable is freed at the end of the enclosing scope", AKA "this is a stack variable". Automatic storage is the default storage class for local variables (of course), and also only valid for local variables, so prior to C23 specifying it was always redundant.
Prior to C99, variable declarations without a type were implicitly given the type int.¹ Thus, in C89 and C95, this declaration is equivalent to auto int x = 'a';
From C99 until C23, this won't compile, but only because variable declarations without a type are illegal. auto is still a legal storage specifier. The relevant GCC/Clang diagnostic is -Wimplicit-int.
In C23 this declaration becomes legal once again, because a variable declared with the auto storage specifier and without a type (a so-called "direct declarator") now performs type inference. This is equivalent to writing auto typeof('a') x = 'a';
"But wait," you might ask, "why is x an int, if its type is inferred from its initializer? Isn't 'a' a char?" Nope! That's the case in C++, but confusingly, character literals in C have the type int, and thus so does x. We would have to write auto x = (char)'a'; to declare x to be a char.
¹A remnant of this behavior persists: writing unsigned, signed, short, long, or long long is equivalent to writing unsigned int, signed int, short int, long int, or long long int.
if you think about it the porn ban was like a boulder falling into a narrow tidal inlet and closing off everything inside it, letting strange new things emerge over time
Its almost offensive when you see someone spreading Israeli propaganda for free like brother you know they're literally giving out soooooooooo much money to spread that shit and youre publicly declaring yourself as irredeemable and not worth talking with for zero us dollars?
20 year anniversary of the first AvA!! Wow, the fact that this series has been going on for so long is astonishing, nevertheless the fact that it's been steadily getting better throughout the years