I am running Ubuntu on a virtual machine with gcc downloaded. I wrote up a code in gedit which contains:
#include <stdio.h>
/* This is a comment. */
int main(int argc, char *argv[])
{
int distance = 100;
// this is also a comment
printf("You are %d miles away.\n", distance);
return 0;
}
When I do the make Ex1.c it says that my file is 'up to date.' so I type in ./Ex1.c and it gives me these errors:
./Ex1.c: line 3: /bin: Is a directory
./Ex1.c: line 4: syntax error near unexpected token '('
./Ex1.c: line 4: 'int main(int arc, char*argv[])'
I don't understand this, I thought it might be how I am typing the code in but then I pasted the code in from the 'Learn C the Hard Way' GitHub and I still get these errors! I just want to run my dang code!