/*assume array is already initialized and declared and is of array type string.*/
int i = 2;
int j = 1;
string newvalue;
cout<<"Current value at array[i][j] is "<<array[i][j]<<endl;
cout<<"Enter new value "<<endl;
cin>>newvalue;
array[i][j]= newvalue; //PROBLEM IS IN THIS LINE.
cout<<endl;
cout<<array[i][j]<<endl;
Hi guys,
I'm having lots of trouble with storing a cin string text into a string array.
It just seem that after I cin newvalue, the program crashes.
Is this way of storing it considered illegal? I'm just a beginner with 5 months of coding experience in C++.