#include <iostream>
template<int bound, typename T>
void f1(T(&ary)[bound])
{
    T x;
    for (int i = 0; i < bound; i++)
    {
        x = ary[i];
        std::cout << x << std::endl;
    }
}

int main()
{
    int a[] = { 1, 2, 3, 4, 5, 6 };
    f1(a);
    return 0;
}

 

相关文章:

  • 2021-07-26
  • 2021-12-04
  • 2021-04-19
  • 2021-09-09
  • 2021-12-06
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-12-12
  • 2022-02-23
  • 2022-12-23
  • 2022-02-10
  • 2021-08-04
相关资源
相似解决方案