Results 1 to 5 of 5

Thread: What is Visual base class in C++?

  1. #1
    Join Date
    Dec 2010
    Posts
    12

    What is Visual base class in C++?

    Hello friends, I am doing technical course from an institution where I was not able to understand what is the term visual base class in C++? I don’t know what is the concept of this term as I have tried to understand from different books but I ended up with a disappointment. I don’t know what to do as I will be having a test on this topic after a week. Can anyone help me out? If anyone having any information then please let me know as soon as possible.

  2. #2
    Join Date
    May 2009
    Posts
    511

    Re: What is Visual base class in C++?

    In multiple inheritance class can inherits the attributes of two or more classes, where as in multilevel inheritance one derived class can serve as a base class for another derived class, hierarchical inheritance involves the derivation of new classes from a base class. All three kind of inheritance can be merged to derive new classes from a base class and derive another class inheriting the properties from derived classes.

  3. #3
    Join Date
    May 2009
    Posts
    539

    Re: What is Visual base class in C++?

    Assume that the grand child has two direct base classes. Child 1 and child 2 which themselves have a common base class parent. In this type of inheritance problem a rises if a member function in the grand child class wants to access data or function of the parent class. There is a problem in inheritance when you are talking about Inheritance.

  4. #4
    Join Date
    May 2009
    Posts
    529

    Re: What is Visual base class in C++?

    consider an example

    class parent
    {
    protected : int data
    } ;
    class child 1 : public parent
    {
    protected : int data 1
    } ;
    class child 2 : public parent
    {
    protected : int data 2
    }

    class grand child : public data 1 , data 2
    {
    protected : int data 3
    }

    the class child 1 have following data
    data from base class
    data 1 declared in own class

    the class child 2 have following data
    data from base class
    data 2 declared in own class

    the grand child have following data

    data from child 1
    data 1 rom child 1
    data from child 2
    data 2 from child 2



    When the class grandchild attempts to access data of a class parent there occurs compilation error. Note that child1 and child2 each inherits a copy of data of the class parent.

  5. #5
    Join Date
    May 2009
    Posts
    543

    Re: What is Visual base class in C++?

    The situation becomes ambiguous when the class grandchild tries to access data. The situation is ambiguous as it is not known to the class grand child to which copy of data to refer to. The duplication of inherited members that is data in our case due to multiple paths can be avoided by making the common base class i.e. class parent virtual base class.

Similar Threads

  1. Using sizeof () class with empty base class in GCC
    By Alfiee in forum Software Development
    Replies: 6
    Last Post: 27-06-2011, 10:31 AM
  2. Event handlers vs. base class method overrides
    By Tailapa in forum Software Development
    Replies: 5
    Last Post: 26-06-2011, 07:38 PM
  3. Compiling error C2504: Base class undefined
    By vISHaTAN in forum Software Development
    Replies: 6
    Last Post: 26-06-2011, 07:35 PM
  4. Replies: 4
    Last Post: 08-01-2011, 07:52 AM
  5. Replies: 5
    Last Post: 12-02-2010, 06:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,290,036.46245 seconds with 17 queries