There's an easier way to do this, you could use a 2D array, but that's just a pain so an array of char *'s or an array of strings would be better.
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
// These strings can't be changed.
char *arr_str[2] = {
"Hello Wazzup??",
"Hello There!!",
};
// These strings can be changed.
string arr_str2[2] = {
"Hello Wazzup??",
"Hello There!!",
};
return 0;
}
The problem with your code was that you were giving the Index array the address of the 20th element of each array, this is out of bounds for both arrays so you get junk. This is your working code.
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char Line1[20] = "Hello Wazzup??";
char Line2[20] = "Hello There!!";
char * Index[2];
Index[0] = Line1;
Index[1] = Line2;
cout << Index[0] << endl;
cout << Index[1] << endl;
return 0;
}