SI am a beginner in programming, and I haven't ever used command line arguments before, so I'm just trying to get the hang of them now. In this, program, it compiles fine, but when I try to run it it gives me the error "Syntax Error near unexpected token('`". I'm not sure what I'm doing wrong. Here's the code...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main ( int argc, char *argv[] )
{
printf("%s\n %s\n", argv[0], argv[1]);
return 0;
}
All I want this program to do is print the command and the first argument. When I get the error, it says it is on line 5, which is the one that contains "int main...". By the way, I realize I included a lot of libraries but that's because I plan on turning this program into a much bigger one once I fix the bugs.