level 3
template <class T>
int count(T &t);
int main(){
int num [6]={1,2,3,4,6,5};
int a=count(num);
std::cout<<a<<std::endl;
std::cout<<num<<std::endl;//这个和下面一个有什么区别么;
std::cout<<#//上面
}
template <class T>
int count(T &t){
return sizeof (t)/sizeof (t[0]);//sizeof (T);
}
2017年08月07日 02点08分
1
level 13
num是一个整型数组,num是数组的第一个元素的地址,是和&num[0]等价的,至于再加个取地址符号,没这么用过
2017年08月08日 01点08分
2
level 4
Your skilll is too poor to start the game development. Try to still learn more basics of cpp.
2017年08月25日 00点08分
4