Although I am using C++, as a requirement I need to use const char* arrays instead of string or char arrays. Since I am new, I am required to learn about how to use const char*. I have declared my const char* array as const char* str[5]
. At a later point in the program I need to populate each on of the 5 elements with values.
However, if I try to assign a value like this:
const char* str[5];
char value[5];
value[0] = "hello";
str[0] = value[0];
It will not compile. What is the proper way to add a char array to char to a const char* array and then print the array? Any help would be appreciated. Thanks.