C and C++ code
Setup development tools to code C and C++
Windows Setup
Use MinGW to install C and C++ compilers
- Install MinGW Installation Manager
- Choose install location:
C:\MinGW
- Go to:
Edit the system environment variables
- Add to System => Path:
C:\MinGW\bin\
Open MinGW and install the following packages in Basic Setup
- mingw32-base-bin
- mingw32-gcc-g++-bin
- msys-base-bin
Debian Setup
Just run the following
sudo apt-get install gcc g++ make -y
Docker Setup
- Install Docker
- Change the file you want to run inside
Dockerfile
and run the following
docker build -t cpp .
docker run --rm -it cpp
Compile
gcc hello.c # c
g++ hello.cpp # c++
Run
./a.out # Linux and MacOS
start a.exe # Windows