Added sample3.cpp