【发布时间】:2015-11-27 10:42:23
【问题描述】:
我正在检查一个作业,我刚刚在一个头文件中找到了这个,我必须在一个 .cpp 中填写:
void setData(const component_t * & data_ptr); // Copy the data from data_ptr to the internal buffer.
//The function ASSUMES a proper size for the incomming data array.
如果您想了解 component_t,它是一个通过 typedef 的浮点数。
那么,我的问题是,data_ptr 是一个什么样的参数?它怎么能被 * 和 & 定义(指针和引用?)。
感谢您的见解!
【问题讨论】:
-
它是对指针的引用。见这里:stackoverflow.com/questions/28510101/…
标签: c++ pointers parameters reference