C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[69971] Re:Re:Re:[초보] 함수 만들기 질문
답변자 [] 2645 읽음    2013-08-12 12:07
헤더 소스
-----------------------------------------------------------------------------------
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;
: : : }
: : : //---------------------------------------------------------------------------
: : :
: : : 이제 막시작한 초보라서 구조체도 모르고 찾아보면서 했는데 위문제는 게시판 찾아봐도 없더라구요 도와주세요 부탁드립니다.

+ -

관련 글 리스트
69967 [초보] 함수 만들기 질문 이근호 2726 2013/08/12
69968     Re:[초보] 함수 만들기 질문 손님 2991 2013/08/12
69970         Re:Re:[초보] 함수 만들기 질문 이근호 2908 2013/08/12
69971             Re:Re:Re:[초보] 함수 만들기 질문 답변자 2645 2013/08/12
69972                 감사합니다.^^ 아주 잘됩니다. 이근호 2722 2013/08/12
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.