Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (lemonhappy):

How do you assign a value to a array element c++? Here's the code I'm working on... #include #include #include #include using namespace std; int main() { srand(time(0)); const string wordList[10] = { "What is 1+1?", "What is 1+2?", "What is 2+2?", "What is 3+2?", "What is 4+2?", "What is 4+8?", "What is 8+8?", "What is 8+9?", "What is 9+1?", "What is 9+2?"};

OpenStudy (lemonhappy):

I'm meant string elemet*

OpenStudy (rsmith6559):

Strings are actually arrays of char. If you wanted to change "What" to "Whot" : wordList[whichString][2] = 'o';

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!