main.cpp as a sample