How to index through argv[1] in C?
<p>If I have:</p>

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

int main(int argc, char *argv[]) {
    int length = strlen(argv[1]);
</code></pre>

<p>and argv[1] one is just a word, for example, "hello", how can I index through it backwards and print out letter by letter? </p>

<p>I tried using strrev, but apparently this isn't in linux and rather than include the function I'd rather just for loop through argv[1] backwards. </p>

<p>I tried:</p>

<pre><code>int i;  
for (i = length; i == 0; i--){

    printf("%c", argv[1][i]);
}
</code></pre>

<p>but I knew this would be wrong before I even executed it. </p>