Skip to main content
Improve answer; added 2 characters in body; edited body; added 16 characters in body
Source Link
Peschke
  • 4.3k
  • 2
  • 19
  • 33

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.

AsEdit:
As some comments and other answers have stated, there are some C “interpreters”interpreters that exist. However, but these generally compile theI would argue that C file into memory and execute them directlycompilers are more popular.

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.

As some comments and other answers have stated, there are some C “interpreters” that exist, but these generally compile the C file into memory and execute them directly.

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.

Improving answer
Source Link
Peschke
  • 4.3k
  • 2
  • 19
  • 33

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.

As some comments and other answers have stated, there are some C “interpreters” that exist, but these generally compile the C file into memory and execute them directly.

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.

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.

As some comments and other answers have stated, there are some C “interpreters” that exist, but these generally compile the C file into memory and execute them directly.

Source Link
Peschke
  • 4.3k
  • 2
  • 19
  • 33

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.