change r variable to char*