Sample using an struct this code i using how sample to test de visual block in the vim and too using to create one CMakeList file to compile them. to compile just make. $ mkdir build && cd build $ cmake .. $ make && ./sample