s***5 发帖数: 2136 | 1 int * GetSomeIDs()
{
int ids[8];
/* The ids are defined here */
return ids;
}
Is there a different way to write "int* GetSomeIDs()" which preserves the
same effective prototype? If so, what is it?
Thanks. |
f******h 发帖数: 45 | 2 不是很理解问题,什么是effective prototype?
是说改函数里面的内容,返回 *id?
还是说改函数的输入输出?比如说改成这个样子。
void GetSomeIDs(int** id)
{
int ids[8];
/* The ids are defined here */
*id = ids;
return;
} |
s***5 发帖数: 2136 | 3 prototype就是返回值,参数列表,函数名。
想来想去,就只能加个inline,const什么的。真是SB公司啊。
【在 f******h 的大作中提到】 : 不是很理解问题,什么是effective prototype? : 是说改函数里面的内容,返回 *id? : 还是说改函数的输入输出?比如说改成这个样子。 : void GetSomeIDs(int** id) : { : int ids[8]; : /* The ids are defined here */ : *id = ids; : return; : }
|