Simple error around which I can't wrap my head.
I installed Ubuntu in my PC a while ago and only now have I started programming in C.
So, I did as instructed:
use gedit to write the code, save it in .c format, open the terminal, write
$cc -c example.c
$cc -o pun pun.c
$./pun.c
But it doesn't work. It return an error that I didn't do.
No matter what my code is, it always this error:
Code:
presidente@presidente-1005HA:~$ cc -c pun.c
presidente@presidente-1005HA:~$ cc -o pun pun.c
presidente@presidente-1005HA:~$ ./pun.c
./pun.c: line 2: syntax error near unexpected token `('
./pun.c: line 2: `int main(void){'
presidente@presidente-1005HA:~$
The code hasn't got any errors or bugs whatsoever, so why does it always say "syntax error near unexpected token `(' "