【发布时间】:2021-03-14 23:26:12
【问题描述】:
#include <stdio.h>
void test2(int (&some_array)[3]){
// passing a specific sized array by reference? with 3 pointers?
}
void test3(int (*some_array)[3]){
// is this passing an array of pointers?
}
void test1(int (some_array)[3]){
// I guess this is the same as `void test1(some_array){}`, 3 is pointless.
}
int main(){
//
return 0;
}
以上三种语法有什么区别? 我在每个部分都添加了 cmets,以使我的问题更加具体。
【问题讨论】:
-
这能回答你的问题吗? Function pointer as an argument
-
最后一个怎么3没用?
-
这段代码到底想做什么?这不是你见过的东西。
-
探索c和c++的语法
-
两种语言都有很多语法,尤其是 C++。并非它的所有排列都是有用的。
标签: c++