error: 'string' is used uninitialized in this function [-Werror=uninitialized]