I am beginning to work with micro controllers and programming them using C language.
All my programming experience is with Python language.
I know that if I want to test a script I have written in python, I can simply launch terminal and type in “python” with the path of the file I want to run.
I tried a web search, but most didn’t seem to understand what I was asking.
How do I run c from terminal?
C is not an interpreted language like Python or Perl. You cannot simply type C code and then tell the shell to execute the file. You need to compile the C file with a C compiler like gcc
then execute the binary file it outputs.
For example, running gcc file.c
will output a binary file with the name a.out
. You can then tell the shell to execute the binary file by specifying the files full path ./a.out
.
Edit:
As some comments and other answers have stated, there are some C interpreters that exist. However, I would argue that C compilers are more popular.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments