hello sir
sir i want to resolve some confustion with u
abt struct and classes
sir in structure we can explicitly combine data structure and their behaviour and also in class, we can implement a object class which consist data structure and behaviour then diffrence is no left like
Code:
#include<iostream.h>
#include<conio.h>
struct student
{
private:
int id;
public:
void set(int i)
{
id=i;
}
int get()
{
return id;
}
};
class hello
{
private:
int x;
public:
void set(int i){ x=i ;}
void display(){
cout<<x;
}
};
void main()
{
int c;
student s1;
hello h1;
s1.set(6);
h1.set(9);
h1.dispaly();
c=s1.get();
cout<<c;
getch();
}