textBox3.Text = textBox1.Text + textBox2.Text; 怎么将Textbox内的string类型装换为int类型?
2个回答
展开全部
C++的话 有 atoi()函数,MSDN中:int atoi( const char *string );
Parameters
string
String to be converted.
Return Values
Each function returns the double, int, __int64, or long value produced by interpreting the input characters as a number.
If the input cannot be converted to a value of that type, the return value is 0 (for atoi and _atoi64), 0L (for atol), or 0.0 (for atof).
The return value is undefined in case of overflow.
直接调用就好了
Parameters
string
String to be converted.
Return Values
Each function returns the double, int, __int64, or long value produced by interpreting the input characters as a number.
If the input cannot be converted to a value of that type, the return value is 0 (for atoi and _atoi64), 0L (for atol), or 0.0 (for atof).
The return value is undefined in case of overflow.
直接调用就好了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询