面试中遇到的问题,面试官也没给解答。求大神知道,这个接口有什么不好:bool IsXP(std::string a);
我觉得是这样:bool IsXP(const std::string &a);
你的解答可以啊。引用,常量参数都是更好的方式
对,字符要引用,而且一般还要加const增强健壮性