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 296 views
3 answers 373 views
2 answers 333 views
2 answers 313 views
5 answers 525 views
2 answers 303 views
1 answer 344 views
...