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 关于#.net#的问题:End Function
  • ¥50 用AT89C52单片机设计一个温度测量与控制电路
  • ¥15 无法import pycausal
  • ¥15 VS2022创建MVC framework提示:预安装的程序包具有对缺少的注册表值的引用
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义
  • ¥15 嵌入式--定时器使用
  • ¥20 51单片机学习中的问题
  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题