An open API service indexing awesome lists of open source software.

https://github.com/pranabdas/c-cpp

Learning programming concepts in C and C++
https://github.com/pranabdas/c-cpp

algorithms c cpp data-structures programming tutorial

Last synced: 5 months ago
JSON representation

Learning programming concepts in C and C++

Awesome Lists containing this project

README

          

Programming in C and C++


Deploy gh-pages status

Follow the tutorial here -

## Quick start

Compile:
```console
gcc filename.c

# linking math lib
gcc filename.c -lm

# show all compiler warnings
gcc -Wall filename.c

g++ filename.cpp

# specify certain standard
g++ -std=c++17 filename.cpp
```

This would produce executable with default name `a.out`. You can specify the
executable name by using the `-o` flag:
```console
gcc filename.c -o program_name
```

For complex programs, you can use `-g` (or `-g3`) flag to embed debugging
information. `-O` flag can be used to optimize the executable file (`-O2`, `-O3`
denotes various levels of optimization).

Compiler (GCC/Clang) flags for warnings: `-Wall`, `-Wextra`, `-Wpedantic`,
`-Wunused`.

## Tools

### Cppcheck

```console
apt install cppcheck
cppcheck --enable=all filename.cpp
```

### Misc
Cleanup (delete) all `a.out` from the `src` directory:
```
find /workspaces/c-cpp/src -type f -name a.out -delete
```

## Resources
-
-
-