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 204 views
3 answers 224 views
2 answers 205 views
2 answers 194 views
5 answers 321 views
2 answers 177 views
1 answer 135 views
...