你好。楼主,我想问下第二题的结果是这么写的吗? template<typename T> void printType(const T&; a){ if(typeid(a)==typeid(int)){ std::cout<<"i am int"<<std::endl; }else{ std::cout<<"i am others"<<std::endl; } } int main(){ printType(1); printType(1.0); }
3 4

相关推荐

牛客吹哨人:哨哥晚点统一更新到黑名单:能救一个是一个!26届毁意向毁约裁员黑名单https://www.nowcoder.com/discuss/1525833
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务