This is a test repository for the C programming language where you can test your C code. It also contains many examples of C code features
You can use main.c to write your C code
There are various ways to run C code in this repository. To find out how to install the necessary tools, please refer to the Resources section.
cpace main.cgcc main.c -o mainTip: Rename
mainin-o mainto any name you want
- Run the compiled code:
./mainNote: You could also use
clanginstead ofgccto compile C code
To run the code in a Docker container, you can use the following commands:
docker build -t c-program .
docker run c-programNote: you need to install Docker on your machine to run the code in a Docker container. The
Dockerfileis already in the repositoryNote: Running the code in a Docker container could be really useful when running not safe c code
Note: If you change the content of the
main.cfile, you need to rebuild the Docker image
- cpace
- GCC - Mac:
brew install gcc - GCC - Linux:
sudo apt-get install gcc - GCC - Windows
- Clang
- Docker
Note: You need to already have
gccandnode.jsinstalled on your machine to install and usecpace