拿什么在结构变量名之前的点? [英] What means the dot before variable name in struct?

查看:104
本文介绍了拿什么在结构变量名之前的点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看着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.

这篇关于拿什么在结构变量名之前的点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆