您当前的位置: 首页 > 
  • 1浏览

    0关注

    880博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

The “right-left“ rule

CodeAllen嵌入式编程 发布时间:2020-09-01 00:04:36 ,浏览量:1

The “right-left” rule is a completely regular rule for deciphering C declarations. It can also be useful in creating them.

“左右”规则是解密C的完全规则声明。在创建它们时也很有用.

First, symbols. Read

  • as “pointer to” - always on the left side [] as “array of” - always on the right side () as “function returning” - always on the right side

*作为“指向”的指针-始终在左侧 []作为“数组”-始终在右侧 ()作为“函数返回”-始终在右侧

as you encounter them in the declaration.

当你开始使用这个规则时

STEP 1

Find the identifier. This is your starting point. Then say to yourself, “identifier is.” You’ve started your declaration.

查找标识符。这是你的起点。然后对自己说“标识符是”

STEP 2

Look at the symbols on the right of the identifier. If, say, you find “()”

关注
打赏
1665938897
查看更多评论
立即登录/注册

微信扫码登录

0.0381s