Hello, I am having trouble with arrays.
Basically, this is what happens:
vector <char*> constArray(10);
char* changingString = "hello";
constArray[0] = changingString;
changingString = "hi";
printf("constArray[0] = %s\nchangingString = %s", constArray[0], changingString);
Output:
constArray[0] = hi
changingString = hi
So, I think constArray[0] is changing because it points to the same location as changingString. My problem is, how do I force constArray[0] NOT to change when changingString is altered?