struct中变量名前面的点是什么意思?

struct中变量名前面的点是什么意思?

问题描述:

查看Linux内核源代码,我发现了这一点:

looking at the linux kernel source, I found this:

static struct tty_operations serial_ops = {
  .open = tiny_open,
  .close = tiny_close,
  .write = tiny_write,
  .write_room = tiny_write_room,
  .set_termios = tiny_set_termios,
};

我从未在C语言中看到过这样的表示法. 为什么变量名前面有一个点?

I've never seen such a notation in C. Why is there a dot before the variable name?

这是指定的初始化程序,这是为C99添加的语法.

This is a Designated Initializer, which is syntax added for C99.