目錄ios
#include<iostream> using namespace std; #define LOG(str) printf("[%s][%s](%d)[%s][%s]:%s\n",__FILE__, __func__, __LINE__,__DATE__, __TIME__, str) template <size_t N> void fun(int (&arr)[N]) { printf("arr len:%lu\n", N); for(unsigned i=0; i<N; ++i) { cout<<arr[i]<<" "; } cout<<endl; } int main() { int arr[] = { 1,2,3,4,5 }; fun(arr); LOG("log"); return 0; }