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

C/C++ Q/A
[6622] 멤버함수 중첩시키기에서 에러메세지...
c장군 [bjg0713] 10064 읽음    2011-11-16 08:54
소스는 인포북에 있는 것이고요. 그런데, 컴파일러는 에러메세지를 냅니다.
소스는 다음과 같습니다.
#include <iostream.h>
typedef unsigned short int USHORT;

class Rectangle
{
    public:
        Rectangle(USHORT width , USHORT height);
        ~Rectangle(){}

        void DrawShape() const;
        void DrawShape(USHORT width , USHORT height) const;

    private:
        USHORT Width;
        USHORT Height;
};

Rectangle::Rectangle(USHORT width , USHORT height)
{
    Width = width;
    Height = height;
}

void Rectangle::DrawShape() const
{
    DrawShape(Width , Height);
}

void Rectangle::DrawShape(USHORT width , USHORT height) const
{
    for(USHORT i=0 ; i<height ; i++)
    {
        for(USHORT j=0 ; j<width ; j++)
        {
            cout << "*";
        }
        cout << "\n";
    }
}

void main()
{
    Rectangle theRect(30,5);

    cout << "DrawShape()\n" << DrawShape() << endl;

    cout << "\nDrawShape(40,2)\n" << DrawShape(40,2) << endl;
}
에서 컴파일 에러메세지는
Error : Function "DrawShape" should have a prototype.
이라고 출력됩니다.
어디서 무엇이 문제인지 좀 어렵네요.

+ -

관련 글 리스트
6622 멤버함수 중첩시키기에서 에러메세지... c장군 10064 2011/11/16
6624     Re:멤버함수 중첩시키기에서 에러메세지... Intotheblue 10453 2011/11/16
6625         Re:Re:멤버함수 중첩시키기에서 에러메세지... c장군 9235 2011/11/16
6627             Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... 신성기 17261 2011/11/17
6628                 Re:Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... c장군 12138 2011/11/17
6626             Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... Lyn 10463 2011/11/16
6630                 Re:Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... c장군 12417 2011/11/17
6631                     Re:Re:Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... Lyn 8403 2011/11/17
6632                         Re:Re:Re:Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... c장군 10658 2011/11/17
6633                             Re:Re:Re:Re:Re:Re:Re:멤버함수 중첩시키기에서 에러메세지... Lyn 12282 2011/11/17
6635                                 멤버함수 중첩시키기에서 에러메세지...(Lyn님 감사합니다.) c장군 10847 2011/11/17
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.