<p>In a program to find whether the given number is an <a href="http://en.wikipedia.org/wiki/Narcissistic_number" rel="nofollow noreferrer">Armstrong</a> number, I stored the input no (3 digit) as string as follows.</p>

<pre><code>char input[10];
scanf("%s",&amp;input);
</code></pre>

<p>Now I have to calculate cube of each digit by using pow method of math.h as follows.</p>

<pre><code>int a;
a = pow(input[0],3);
</code></pre>

<p>By coding like this, I could not get correct result.  If I print the value of "a", it shows some irrelevant answer. My doubt is, how to convert from string value to integer value? </p>

You do not need to get the address of the
```
input
```
array using
```
&input
```
. Simply passing
```
input
```
will pass the pointer to your string to scanf(). Your call to scanf() should look like this:
```
```
scanf("%s", input);
```
```
Another way of doing it, with the address of operator:
```
```
scanf("%s", &input[0]);
```
```