【问题标题】:Can not understand the return of this function in C++无法理解 C++ 中这个函数的返回
【发布时间】:2014-10-13 07:37:10
【问题描述】:

谁能帮我理解这个功能?

CheckList(Listfile*& Listitems,bool showSortList)

Listfile 是一个类,但我不明白Listfile*& 是什么,Listitems 会返回什么?

【问题讨论】:

    标签: c++


    【解决方案1】:

    这是一个reference to a pointer

    CheckList(Listfile*& Listitems,bool showSortList)
              ^^^^^^^^^ pointer to Listfile
                       ^ reference
    

    你应该更好地学习C++,这可以在any decent C++ book找到。

    【讨论】:

    • +1。此外,像“任何像样的 C++ 书籍”这样的短语最好附上指向 list of good C++ books here on SO 的链接。
    • 我正在同时学习/使用 C++,现在至少一步一步地尝试理解这门语言。谢谢大家的帮助。
    【解决方案2】:

    它正在占用reference of pointer to Listfile。在此处查看此主题的详细信息: http://www.codeproject.com/Articles/4894/Pointer-to-Pointer-and-Reference-to-Pointer

    Passing references to pointers in C++

    【讨论】:

    • 感谢您的链接:D
    猜你喜欢
    • 2012-11-21
    • 2018-02-09
    • 2013-05-04
    • 2016-04-03
    • 2018-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多