How to convert int [12] to array<int, 12>

code:

// array::data
#include <iostream>
#include <cstring>
#include <array>

int main ()
{
  const char* cstr = "Test string";
  std::array<char,12> charray;

  std::memcpy (charray.data(),cstr,12);

  std::cout << charray.data() << '\n';

  return 0;
}

Re:
1.cplusplus.com;

End

posted on 2018-06-04 16:57  鹅要长大  阅读(159)  评论(0编辑  收藏  举报

导航