LANGUAGES | C | C LANGUAGE INTERVIEW QUESTION AND ANSWERS | 11

What are the advantages of inheritance

C Language Interview Question and Answers:

51. What are the advantages of inheritance?              
    Code reusability
    Saves time in program development.

52. What is multiple inheritance?
                A class can inherit properties from more than one class which is known as multiple inheritance.

53. What is static memory allocation?
                Compiler allocates memory space for a declared variable. By using the address of operator,the reserved address is obtained and this address is assigned to a pointer variable. This way of assigning pointer value to a pointer variable at compilation time is known as static memory allocation.

54. what is difference between function overloading and operator overloading?
                A function is overloaded when same name is given to different function.
While overloading a function, the return type of the functions need to be the same.

55. what is the difference between c &c++?
                c++ ia an object oriented programing but c is a procedure oriented programing.c is super set of c++. c can't suport inheritance,function overloading, method overloading etc. but c++ can do this.In c-programe the main function could not return a value but in the c++ the main function shuld return a value.

No comments:

Post a Comment