- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
#include <stdio.h>
#include <math.h>
#define SET(var, ...) typeof(__VA_ARGS__) var = __VA_ARGS__
SET(p, &puts);
struct point_t { double x, y; };
SET(point, (struct point_t){0.0, 1.0});
SET(anonymous, (struct{char *s;}){"hui"});
int main(void)
{
static SET(msg, "Halo!");
p(msg);
SET(sqrt_of_2, sqrt(2));
printf("√2 = %f\n", sqrt_of_2);
return 0;
}
То ли дело «Watcom C» с произвольными коллконвеншнами.
https://stackoverflow.com/questions/40143815/is-it-possible-to-implement-gnu-cs-typeofx-with-c11s-generic
Именно поэтому я за "GNU C".
«Еби свою» бот распознал как «he visto un». Надмозг.
https://translate.google.com/#zh-CN|ru|八十万阿辉
https://translate.google.com/#zh-CN|ru|巴适哦我比四度
Нажми кнопку «Проговорить» на левой стороне.
Пролистай в самый низ страницы https://gcc.gnu.org/onlinedocs/gcc/Typeof.html
> In GNU C, but not GNU C++, you may also declare the type of a variable as __auto_type. In that case, the declaration must declare only one variable, whose declarator must just be an identifier, the declaration must be initialized, and the type of the variable is determined by the initializer; the name of the variable is not in scope until after the initializer. (In C++, you should use C++11 auto for this purpose.)
Не для меня Дон разольётся,
И сердце девичье забьётся
В восторге чувств не для меня.