Results 1 to 2 of 2

Thread: Constructor คืออะไรครับใน C++

  1. #1
    Anonymous
    Guest


    Constructor คืออะไรครับใน C++

    พึ่งหัดเขียนครีบ

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    Re: Constructor คืออะไรครับใน C++

    Constructer คือ ส่วนหนึ่งของ Class ที่จะถูกเรียกโดยอัตโนมัติหลังจากที่สร้าง object

    [src]
    #include < iostream.h >

    class obj
    {
    public:
    obj()
    {
    cout<<" obj created.n";
    }

    ~obj()
    {
    cout<<" obj destroyed.n";
    }



    };


    int main()
    {

    obj a =new obj();
    return 0;
    }

    [/src]

    output
    [src]
    obj created
    obj destroyed
    [/src]

Similar Threads

  1. Icon Constructor 3.54
    By RavMonK in forum Window Application
    Replies: 0
    Last Post: 14-09-2007, 05:43 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •