Typecasting initialize for cpp project