Friend Function in C++ ?
Friend Function in C++ ?
#include <iostream.h>
using namespace std;
void func();
void func(int);
void func(float);
void func(int, float);
void func(int, float, int);
int main()
{
int x = 10;
float y = 3.14;
int z = 20;
func();
func(x);
func(y);
func(x, y);
func(x, y, z);
return 0;
}
void func(){
cout<<"Hello World!"<<<"value="" of="" a="" :="" "<<a<<<c<<="" pre=""
style="box-sizing: border-box; font-family: "Noto Sans";">
}
~test ()
{
Count<<” object destroy “ ;
}
};
Void main()
{
Test ob;
Getch();
}
Template
Syntax :-
(1). Function Template :-
Template< Class Type >
Return Type Functionname( parametered list)
{
Body
}
Syntax 2 :-
(2). Class Template:-
Template< Class Type >
Class Classname( parametered list)
{
Public:
Type var;
Type functioname (type arg)
}
Base
Derive
Base
Derive 1
Derive 2
3. Multiple Inhertance
Base 1 Base 2
Derive
Base
Derive 1 Derive 2
5. Hybrid Inheritance
Student
Result