//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Assignment2_c.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
double no1,no2;
AnsiString oprator;
no1=num1->Text.ToDouble();
no2=num2->Text.ToDouble();
oprator=oprtor->Text;
if (oprator=='+') {
this->result->Caption=AnsiString(no1+no2);
}
else if (oprator=='-') {
this->result->Caption=AnsiString(no1-no2);
}
else if (oprator=='/')
{
if (num2!=0) {
this->result->Caption=AnsiString(no1/no2);
}
else
{ShowMessage(" You have to put non-zero numbers"); }
}
}
실행시키니
Project Assignment2_p.exe raised exception class EConvertError with message "" is not a valid floating point value'
라는 알수없는 에러메시지가 뜨네요 ㅠㅠㅠㅠㅠㅠ +, -, / 문자 쓰는거 저렇게 하면 되나요 ㅠ 잘못된 곳 좀 찾아주세요 3시간 넘게 끙끙대는데 안되요 ;
|