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.c
gcc main.c -o main
Tip: Rename
main
in-o main
to any name you want
- Run the compiled code:
./main
Note: You could also use
clang
instead ofgcc
to 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-program
Note: you need to install Docker on your machine to run the code in a Docker container. The
Dockerfile
is 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.c
file, 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
gcc
andnode.js
installed on your machine to install and usecpace