Hi, I have the following code which works, but can someone please help me with how I may instead put the tasks of populating the array and printing the array in two separate functions, and how I may call those functions? I can do it if it was an array of integers or something like that but it doesn't work for me with an array of strings. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
usingnamespace std;
int main () {
//Populate array:
char *months[] = {"January","February","March","April"};
//Print array:
for (int i=1;i<3;i++) {
cout << months[i] << endl;
}
return 0;
}