dongqiao0953 2015-07-08 22:57
浏览 73
已采纳

此语法是指向切片的指针还是切片的指针?

After looking at this blog post, I am still unclear about whether the following syntax means a slice of pointers or a pointer to a slice.

foo  []*int

Which one is it, and what is the general rule of thumb for this case?

  • 写回答

2条回答 默认 最新

  • douzhu6149 2015-07-08 23:01
    关注

    This is a slice of pointers, just read from left to right: ([]) a slice of (*) pointers to (int) integer. On the other hand, *[]int would be (*) a pointer to ([]) a slice of (int) integers.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败