How to define and initialize char array object in C++

1 Answer

0 votes
#include <iostream>
#include <array>

int main ()
{
  std::array<char, 10> arr = {'c', '+', '+'};

  std::cout << arr.data();

  return 0;
}
 
 
 
/*
run:
 
c++
  
*/

 



answered Jul 28, 2020 by avibootz

Related questions

1 answer 292 views
3 answers 364 views
2 answers 327 views
2 answers 306 views
5 answers 517 views
2 answers 296 views
1 answer 337 views
...