jimsrc / c_lessons

lessons from C and C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LESSONS FROM C & C++

Different lessons with the following titles.


c_array:

Implementation of 2D and 3D arrays with a contiguous block of memory. The same code tests this contiguous aspect. To run:

make clean
make
./exe

global:

use of global variables w/ linked objects.

This code handles/modifies a global variable from different linked objects. To run:

cd global/linked 
make clean 
make
./exe

templates:

use of templates with linked objects 😃

To run:

cd templates
make clean 
make
./tt.x

exceptions:

use of try/catch :trollface:

try{
...
}
catch{
...
}

backward-cpp:

reports the stack trace (it would be nice to report the line sentence of every call of the chain). :squirrel:


TODO:

usefulness of static/const variables and functions!


Quote:

A general rule of thumb is that your program spends 80% of its time running 20% of the code. Thus a good strategy for efficient coding is to write everything, profile your code, and optimize the parts that need it. Python’s profilers are great, and Cython allows you to do the latter step with minimal effort. - Hoyt Koepke


About

lessons from C and C++

License:GNU General Public License v3.0


Languages

Language:HTML 79.5%Language:Vim Script 10.5%Language:C++ 9.2%Language:C 0.6%Language:Makefile 0.2%Language:Python 0.0%