C++ converting character in vector to an integer...tough, need help?
<p>This is what I have:</p>

<pre><code>char userInput;
int position;
vector&lt;string&gt; userVector(7);
vector&lt;int&gt; someVector(7,1);

cin &gt;&gt; userInput;
cin &gt;&gt; position;

if(userInput == 'X')
   userVector[position] = '1';

if(userVector[position]-someVector[position] == 0)
   cout &lt;&lt; "Success"
</code></pre>

<p>My problem is that <code>userVector[position]</code> is actually a character, because <code>userVector</code> is a string vector.  However, I need this calculation to take place <code>(userVector[position] - someVector[position])</code> because I need to determine if the outcome is 0 or some other number.  Any help?</p>

<p>In case it doesn't make sense here, userVector HAS to be a string vector, because it's part of the requirements for this program.  Basically, a user is supposed to be allowed to enter an "X" anywhere in the userVector vector, and you have to tell them if it matches expected outputs.</p>

<p>So, in this case, the "expected output" would be someVector, which has a 1 in all of it's spaces.  What I'm trying to do is subtract the two vectors so that if the user enters anything other than X, the vector subtraction will not equal 0, and consequently, result in the program doing something different.</p>

<p>Hope that clears things up!</p>
