在C ++中使用switch语句 [英] use of switch statment in c++
本文介绍了在C ++中使用switch语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在c ++中使用组切换.
我想使用组切换语句.实际上我正在使用Crystalfontz LCD显示器.我想制作基于菜单的程序,
所以我想用这个.
how to use group switching in c++.
i want use group switch statement. actually i am working on crystalfontz lcd display.i want to make menu based program,
so i want to use this.
推荐答案
组切换语句
意思是您在谈论嵌套的switch语句?然后看看这个,
嵌套开关语句
MSDN C ++ Switch语句
group switch statement
Means are you talking about nested switch statements? Then look into this,
Nested switch statements
MSDN C++ Switch statements
您的问题不清楚:
您所说的组切换是什么!
这是使用开关的一种形式!
CString func(int case)
{
CString a =";
开关(盒)
{
情况1:
情况2:
a =一个和两个";
休息;
情况3:
情况4:
a =三三四"
休息时间:
}
返回a;
}
your question is not clear:
what you mean by group switching!
this is one form of using switch!
CString func(int case)
{
CString a = "";
switch(case)
{
case 1:
case 2:
a = "one and two";
break;
case 3:
case 4:
a = "threre and four"
break:
}
return a;
}
这篇关于在C ++中使用switch语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文