add main source
Change .c to .cpp