注册 登录
编程论坛 C++ Builder

Edit->text怎么转换成float的值

KS010005 发布于 2021-04-12 15:19, 1913 次点击
void __fastcall TForm1::Button1Click(TObject *Sender)
{
double k,s;
float a=atof(Edit1->Text);
int b=atoi(Edit2->Text);
float c=atof(Edit3->Text);
s=a/2/tan(b/2*3.1415926/180);
k=s+c;
}
1 回复
#2
dlck20212021-04-12 19:05
float c = StrToFloat(Edit1->Text);
1