|
답변자 님이 쓰신 글 :
: 헤더 소스
: -----------------------------------------------------------------------------------
: private: // User declarations
: public: // User declarations
: String TForm1::upnum(float target); <-------이부분 삭제
: String upnum(float target); <-------로 변경
: __fastcall TForm1(TComponent* Owner);
: };
: //---------------------------------------------------------------------------
: extern PACKAGE TForm1 *Form1;
: //---------------------------------
:
:
: 이근호 님이 쓰신 글 :
: : 답변감사드립니다.
: :
: : 답변하신 와중에 원본글을 약간 수정하였습니다 헤더파일에도 같은것을 추가하였습니다. 그 후에 말씀하신대로 변경했으나 에러메세지가 다음과같이 발생합니다.
: : [Linker Error] Unresolved external '__fastcall TForm1::FormCreate(System::TObject *)' referenced from C:\USERS\ALKO11130059\DESKTOP\U-COM PROGRAM\UNIT1.OBJ
: :
: : 변경후 소스
: : -----------------------------------------------------------------------------------
: : LabeledEdit11->Text = FloatToStr(no1res * 1.5).sprintf("%2.0f",no1res * 1.5);
: : LabeledEdit12->Text = upnum(no1res);
: : LabeledEdit13->Text = LabeledEdit19->Text;
: :
: : }
: :
: : String TForm1::upnum(float target) <------이부분 변경이요
: : {
: : String Astring;
: : String Bstring;
: : String Finalstring;
: : float Afloat;
: : -----------------------------------------------------------------------------------
: :
: : 헤더 소스
: : -----------------------------------------------------------------------------------
: : private: // User declarations
: : public: // User declarations
: : String TForm1::upnum(float target); <-------이부분 변경이요
: : __fastcall TForm1(TComponent* Owner);
: : };
: : //---------------------------------------------------------------------------
: : extern PACKAGE TForm1 *Form1;
: : //---------------------------------
: :
: : -----------------------------------------------------------------------------------
: :
: :
: : 손님 님이 쓰신 글 :
: : : String upnum(float target) -> String TForm1::upnum(float target) 올 변경하세요....
: : :
: : : 이근호 님이 쓰신 글 :
: : : : 안녕하세요 오늘 C++ 빌더를 시작했는데요,
: : : :
: : : : 함수만드는데 계속 에러가 생겨서 질문을 드립니다.
: : : :
: : : : void __fastcall TForm1::Button2Click(TObject *Sender)
: : : : {
: : : :
: : : : no1res = StrToFloat(LabeledEdit8->Text);
: : : : no1fus = StrToFloat(no1res * fuseconst);
: : : : LabeledEdit5->Text = FloatToStr(no1fus).sprintf("%3.2f",no1fus);
: : : : //--------------------------------------
: : : : no2res = StrToFloat(LabeledEdit9->Text);
: : : : no2fus = StrToFloat(no2res * fuseconst);
: : : : LabeledEdit6->Text = FloatToStr(no2fus).sprintf("%3.2f",no2fus);
: : : : //--------------------------------------
: : : : no3res = StrToFloat(LabeledEdit10->Text);
: : : : no3fus = StrToFloat(no3res * fuseconst);
: : : : LabeledEdit7->Text = FloatToStr(no3fus).sprintf("%3.2f",no3fus);
: : : : //--------------------------------------
: : : : LabeledEdit17->Text = FloatToStr(no1res * 1.5).sprintf("%2.1f",no1res * 1.5);
: : : : LabeledEdit18->Text = FloatToStr(no2res * 1.5).sprintf("%2.1f",no2res * 1.5);
: : : : LabeledEdit19->Text = FloatToStr(no3res * 1.5).sprintf("%2.1f",no3res * 1.5);
: : : : //--------------------------------------
: : : : LabeledEdit11->Text = FloatToStr(no1res * 1.5).sprintf("%2.0f",no1res * 1.5);
: : : : LabeledEdit12->Text = upnum(no1res); <--------------이부분에서 다음과 같 에러가 납니다. [C++ Error] Unit1.cpp(88): E2268 Call to undefined function 'upnum'
: : : :
: : : : LabeledEdit13->Text = LabeledEdit19->Text;
: : : :
: : : : }
: : : : String upnum(float target)
: : : : {
: : : : String Astring;
: : : : String Bstring;
: : : : String Finalstring;
: : : : float Afloat;
: : : : float Bfloat;
: : : : Astring = FloatToStr(target).sprintf("%2.1f",target);
: : : : Bstring = FloatToStr(target).sprintf("%2.0f",target);
: : : : if(StrToFloat(Astring)>=StrToFloat(Bstring))
: : : : {
: : : : float finalfloat;
: : : : finalfloat = StrToFloat(Bstring)+0.5;
: : : : Finalstring = FloatToStr(finalfloat);
: : : : }
: : : : else
: : : : { Finalstring = Astring;
: : : :
: : : : }
: : : : return Finalstring;
: : : : }
: : : : //---------------------------------------------------------------------------
: : : :
: : : : 이제 막시작한 초보라서 구조체도 모르고 찾아보면서 했는데 위문제는 게시판 찾아봐도 없더라구요 도와주세요 부탁드립니다.
|