考虑以下代码:
#include <stdio.h>
int main()
{
struct test {
int i;
int t;
};
struct test hello = (struct test) {
.i = 0,
.t = 1
};
printf("%d, %d\n", hello.i, hello.t);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:
0, 1
Run Code Online (Sandbox Code Playgroud)
我的问题是这条线(struct test) {.i = 0, .t = 1 }在做什么?
它是否在输入一个代码块来输入struct test?甚至可能吗?
如果没有请告诉我它在做什么,谢谢.
c ×1