base(int a) : z(a)
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: base(int a) : z(a)

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Post base(int a) : z(a)

    class base
    {
    public :
    int x,y;
    const int z;
    base(int a) : z(a)
    {
    x=0;
    y=0;
    }
    void display()
    {
    printf("%d\t%d\t%d\n",x,y,z);
    }
    };
    void main()
    {
    base b(5);
    b.display();
    }



    Can any explain the meaning of "base(int a) : z(a)"

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,931

    Re: base(int a) : z(a)

    base(int a) is a specialized constructor, z(a) - initializer for z member.
    Best regards,
    Igor

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center