Sscanf and Sprintf convert string to decimal?
<p>I need to solve the following exercise:</p>

<blockquote>
  <p>"Write a program that acquires the first characters of a string an integer octal and write it on another string previously empty, then display the contents of this second string in decimal, using the functions <code>sscanf</code> and <code>sprintf</code>.
  For example, if the user enters 12 (octal) the system must show 10 (decimal)."</p>
</blockquote>

<p>After my <code>scanf</code>, the array <code>seconda</code> is <code>="12325"</code>.
The problem is that I do not know how to make understand that this string is an octal number and how to convert it to decimal with <code>sprintf</code>.  </p>

<p>This is my current code:</p>

<pre><code>#include &lt;stdio.h&gt;

int main(void) {
    char prima[] = "12325dsdfa";
    char secodna[500];

    sscanf_s(prima, "%[0123456789]o", secodna, 500);
}
</code></pre>