C- Arguments input
<p>Is there a better way to take in inputs,
For example: 
ls = list all files in the current dir ... 
cat Q1.c will display etc </p>

<p>To me it seems like I'm hard coding it at this point</p>

<pre><code>int main(int argc, char *argv[])
{    
    int i;
    char *dest = NULL;
    if(argc==1) {
        printf( "No arguments were passed.\n" );
    } 
    else {
        printf("Arguments:\n");
        for(i=1;i&lt;argc;++i) {
            printf("%d. %s\n", i, argv[i]);
            dest = malloc(strlen(argv[i])+1);
            if(i&lt;2) {
                sprintf(dest, "%s",argv[i]);    
            }
            else {
                sprintf(dest, "%s %s", argv[i-1], argv[i]); 
            }
        }   
        mysystem(dest);
    }
    return 0;
}
</code></pre>