use cstring instead of string.h
fixed compilation errors and warnings on MSVC