C++助教篇2_Week1找bug
发布日期:2021-05-08 04:54:04 浏览次数:21 分类:精选文章

本文共 373 字,大约阅读时间需要 1 分钟。

下面的语句并不能得到输出1,输出one;输入2,输出two的效果。请问是为什么?

int i = 0;std::cin >> i;switch (i) {       case '1':        std::cout << "one";        break;    case '2':        std::cout << "two";        break;}

下面的代码OK吗?为什么?

class MyClass {   public:    void function(int a = 0, int b = 0);};void MyClass::function(int a = 0, int b = 0) {    ; }void MyClass::function(int a, int b = 0) {    ; }
上一篇:语义化版本编号(Semantic Versioning)
下一篇:为啥redis是单线程的?

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2025年04月02日 17时44分56秒