在计算器程序的单个编辑框中获取两个输入 [英] Get Two Input in Single Edit Box in Calculator Program
本文介绍了在计算器程序的单个编辑框中获取两个输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如何在Visual Studio 2005的VC ++中的单个Edit Box中获得两个输入
就像从单个Function中的Edit Box(Divident)和Second Input(Divisor)获取输入一样.我编写了无法正常工作的代码,我尝试了很多方法...
Hi Everyone,
How to get two input in a single Edit Box in VC++ in Visual Studio 2005
Its like getting an input from Edit Box(Divident) and second input(Divisor) in single Function.I have written a code which is not working i have tried many ways......
void CCalciDlg::OnBnClickedCbuttondiv()
{
double a,b;
resu.SetFocus();
UpdateData(TRUE);
a=num1; //num1 is the Edit Box Resource
resu.SetFocus();
a=num;
UpdateData(TRUE);
resu.SetFocus();
b=num1;
num=a/b;
}
此代码将a和b都设为相同...
This Code Taking Both a and b as the same......
推荐答案
如果您需要从字符串(编辑框内容)中检索多个值,则(假设有可能,即存在值分隔符),您必须对其进行解析(例如,参见 Parsing_expression_grammar [ ^ ].
If you need to retrieve multiple values from a string (the edit box content) then (supposing it is possible, i.e. there are value separators) you have to parse it (see, for instance Parsing_expression_grammar[^].
这篇关于在计算器程序的单个编辑框中获取两个输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文