C++ Foundation —— (22) C++14 switch
»
    switch(val){
    case 0:
        std::cout<<"val is zero"<<std::endl;
        break;
    case 1:
    case 2:
    case 3:
    case 4:
        std::cout<<"val is not zero, but val is small than 5"<<std::endl;
        break;
    case 5:
        std::cout<<"val is 5"<<std::endl;
        break;
    default:
        std::cout<<"val is not in [0,5]"<<std::endl;
    }
«
--Alex.Zhang
--www.v-signon.com Learningers Co-Encouraged
Back
Personal Art: www.up-task.com Unit: Individual
中文 Русский 京ICP备19038994号-2
If the content on this website infringes upon your any rights, please contact me at 1307776259@qq.com for removal