The code snippet below creates what kind of a problem? int main() { } string* myword [20]; for (int i = 0; i < 10; i++) { myword [i] = new string ("YouHadMeAtHello"); } cout << *myword [15] << endl; return 0; Off by one error Invalid pointer dereference Memory leak Array index out of bounds

icon
Related questions
Question
The code snippet below creates what kind of a problem?
int main()
{
}
string* myword [20];
for (int i = 0; i <10; i++)
{
myword [i] = new string("YouHadMeAtHello");
}
cout << *myword [15] << endl;
return 0;
Off by one error
Invalid pointer dereference
Memory leak
Array index out of bounds
Transcribed Image Text:The code snippet below creates what kind of a problem? int main() { } string* myword [20]; for (int i = 0; i <10; i++) { myword [i] = new string("YouHadMeAtHello"); } cout << *myword [15] << endl; return 0; Off by one error Invalid pointer dereference Memory leak Array index out of bounds
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer