Any idea why this isn't working in C++? I feel like it's really simple, but I can't figure it out:
int main() {
int arraySize = 5;
char testArray[arraySize] = {'a', 'b', 'b', 'c', 'd'};
}
It works fine when I hard code 5 as the array size, but it doesn't like it when I use a variable name instead. Ultimately I'm trying to figure out how to write a function that deletes duplicate characters from the array, but I can't even get the array initialized.