error: comp. bet. signed/unsigned integer expressions CODEBLOCKS
<p>the assignment is: have a number saved in a string, then convert from a string to an integer--> convert that number to a decimal number from N-base the user inputs.</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

int main()
{
    string snum;
    int n=0, base, res;

    cout &lt;&lt; "enter n: ";
    cin &gt;&gt; snum;
    cout &lt;&lt; "enter base: ";
    cin &lt;&lt; base; //THIS IS LINE 13

    for (int i=0; i&lt;snum.length(); i++) // des order
    {
        int digit = snum.at(i) - '0';
        n = (n*1) + digit;
        if (


       base &lt;= 10
        )   res = base * n;

    cout &lt;&lt; "n is " &lt;&lt; res &lt;&lt; endl;

    }
</code></pre>

<p>}</p>

<p>Im getting error: NO MATCH BETWEEN SIGNED AND UNSIGNED INTEGER EXPRESSIONS [Line 13]</p>

<p>ty all!!</p>

<p>*if u find any problems in logic please let me know!
*using codeblocks</p>
