Some basic functions in c++