Tag: How to initialize a Char Array in C++?
How to initialize a Char Array in C++?
This tutorial will discuss about a unique way to initialize a char array in C++. We can initialze a char array with a string while defining the array. Like this, char arr[50] = “Sample text”; But we need to make sure that the array is big enough to hold all the characters of string. Otherwise …