title: Replace data in 2D vector C++
body: <p>I am trying to search a 2D vector for a char, namely a '?' and replace it with 'x'.</p>
  
  <p>I have no issues doing this task with a single vector but keep having issues with the a 2D vector implementation, see below for code.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  
  int main()
  {
          // An empty vector of vectors
          vector&lt;vector&lt;char&gt; &gt; v2d;
  
          // Create a vector with 5 elements
          vector&lt;char&gt; v2(5, '?');
  
          // Create a vector of 3 elements. 
          vector&lt;vector&lt;char&gt; &gt; v2d2(3, v2);
  
          // Print out the elements
          cout &lt;&lt; "Before Vector Update" &lt;&lt; endl;
          for (int i = 0; i &lt; v2d2.size(); i++) {
              for (int j = 0; j &lt; v2d2[i].size(); j++)
                  cout &lt;&lt; v2d2[i][j] &lt;&lt; " ";
              cout &lt;&lt; endl;
          }
          cout &lt;&lt; "" &lt;&lt; endl;
  
          /* Does not work as expected
          cout &lt;&lt; "Vector Update" &lt;&lt; endl;
          for (int i = 0; i &lt; v2d2.size(); i++) {
              for (int j = 0; j &lt; v2d2[i].size(); j++)
              {
                  if (v2d[i] == '?');
                  (v2d[i] = 'x');
              }
          }
          */
  
          cout &lt;&lt; "" &lt;&lt; endl;
          cout &lt;&lt; "After Vector Update" &lt;&lt; endl;
          for (int i = 0; i &lt; v2d2.size(); i++) {
              for (int j = 0; j &lt; v2d2[i].size(); j++)
                  cout &lt;&lt; v2d2[i][j] &lt;&lt; " ";
              cout &lt;&lt; endl;
          }
  
  system("pause &gt; NULL");
  return 0;
  }
  </code></pre>
  
  <p>I receive the error message below when I try and compile the code.</p>
  
  <p>IntelliSense: no operator "==" matches these operands operand types are: std::vector>, std::allocator>>> == char  Project3\Source.cpp 77  16  Project3</p>
  
  <p>I believe it is an issue with the container in updating the proper row and column. Any help would be much appreciated.</p>
  
  <p>Thank you</p>