Lets say I have a 2d array of chars that looks like:
ooooooooo
ooooooooo
ooooooooo
ooooxoooo
ooooooooo
ooooooooo
ooooooooo
lets say i want to replace all the o's to be I instead so it would look like this:
IIIIIIIII
IIIIIIIII
IIIIIIIII
IIIIxIIII
IIIIIIIII
IIIIIIIII
IIIIIIIII
the current way im getting input from the user is using the command line:
int main(int argc, char* argv[]) {
This is what ive come up with so far:
void replacee(vector<vector<char>> &vec, char oldd, char neww) {
for(vector<char> v:vec)
// change
{
for(char c:v)
if (c == oldd) {
c == neww;
}
}
}
Ps. Sorry if this is a simple solution, im new to c++ and ive looked up ways other people have done it but they have always had a vector of Strings instead of char's.