#include using namespace std; //Structure of class class Animal{
//Private variables accessible only with the help of function. private: int leg, eyes, ears; public: int sound, speed; void setData(int a1, int b1, int c1); // Declaration only void getData() { cout
#include using namespace std; class animals{ private: int eyes; int legs; int ears; public: int speed; int voice; void setdata(int a, int b, int c){ eyes=a; legs=b; ears=c; } void getdata(){ cout
Time Stamp - 14:59 #include using namespace std; class Students { private: int roll_no; string religion; public: string f_name; int standard; int age; void setData(int r, string rel); // r stands for roll_no & rel stands for religion. void getData() { cout
@@curiousritik4558 Bhai coding line me aaye ho syntax error ho ya koi bhi error ho wo toh tumko hi solve krna h Dhyaan do toh sirf logic pe Yha gulshan ne kitne badhiya logic se ye problem likha h
#include using namespace std; class animal{ private: int age,height,length; public: string name,species; void setdata(int a,int h, int l); //note:a,h,l are just 3 random variables we have used to signify that we will be using 3 integers. void getdata(){ cout
Love from Bangladesh Harry Bhai 🇧🇩🇧🇩❤️ 14:45 Here,the example of a class is car It can have different properties like - Brand - Color - Transmission - Mileage
// Class 15:00 class Program{ private: int age; char qualification; public: char languages; int projects_made; int time_experience; // --> write this in years; }
Q 1: Write a C++ function “addition” that will take two arguments “istVal” and “secVal” as integer arguments and the function will add the values of “istVal” and “secVal” and return the result to the calling statement in main function.
#include using namespace std; class Sum{ public: int sum; int add(int istVal, int secVal); }; int Sum :: add(int istVal, int secVal){ sum= istVal + secVal; return sum; } int main(){ Sum s; cout
Enter the name of the animal Dog Enter the favourite food Biscuits How many legs they have 4 What is lifespan of dog 20 The name of the animal is dog Loves to eat biscuits Dog has 4 leags The lifespan of dog is 20 Years
@@myth_snipe7737no its not required you can define string variables in c++ if you want to use string functions than the string.h header file required
Main pichle 5 dino se aise languages doondh raha tha jo bahut tuff ho sikhne mein time lage baad mein mujhe mili c++ bhai ne use bhi easy bana diya 😢rona aa raha hai
you might be earning good .... but here you are earning the blessings and good wishes of all struggling students who were looted by the paid training goons after expensive degree expanses and the poeple looted on the name of internship ....god bless. u dear .....keep it up
14:55 #include using namespace std; class animal{ private: int areanum; int sellingvalue; public: int population; int speed; void setdata(int sellingvalue,int areanum); void getdata(){ cout
Hello kindly c++ kai projects bhi bananna jis tara python kai app nai banye the..... Jis mai sare c++ kai topics covers hojay.... Make projects for c++. Thank u.
challanged accepted sir , and your way of teaching is really very good , videos are short but cover every point of the topic . really very helpfull to learn C++ . thank you sir 😊
class Animal{ private: string sound; int number ; // all animals has different sound public: string colour,food; void setdata(string so,int sp); void getdata(){ cout
protected modifiers have properties of both public and private modifiers. You can inherite properties from a protected modifiers but it will still be private for the user.
Harry SIR, i tried a example - 14:47 #include #include using namespace std; class pen{ private : float price; string ink_colour; public : void get_data() { coutprice; coutink_colour; } void prn_data() { cout
bro we can make functions using struct the only difference between struct and class is by default in struct variables are public whereas in class they are private.
adarsh mishra not only inheritance there are many class properties which you can see in prev-vedio or search about it. So bcoz of that all properties of class makes a huge diff between structure and class
If you are using struct in cpp than there us no difference in class or struct...... You can also use the concept of inheritance in struct .... Know your fact before talking
#include using namespace std; class person { public: string name; int age; int height; int weight; void getdata() { cin>>name>>age>>height>>weight; } void talk() { cout
Syntax galat likha h aap ne setdata(int a1,int b1, int c1) hoga . Badd mai jab main () mai jab user input daalega wo a1 , b1, c1 mai store hoga fhir uske value a, b, c mai chale jayege. Fhir cout
Sir, Are the content(variables + functions) written in the public category up to the end of the class '}' is considered as public or it gets terminated after the semicolon; at the end of the next line where public was written?
Functions are created for private use only... Set data... Is used bcoz we want to access the private variables through function... And get data is jst to print it.. To access the public variable we don't need functions we can directly access it.. By using dot..
time space - 14:59 #include #include using namespace std; class TATA { private: int car_number; string name; public: string c_name; // c declar for a car string type; float price; float speed; float weight; void cardetails(int number,string a); void getdata(){ cout
Sir please design a cource for visual programming with c# i direly need it. You are the only one person to whom i can understand. Please sir upload this cource i shall be very thankful to you.
13:10 aapne pehle btaya tha ki template same ho to koi frk nhi pdta..is case me age do employee class bna diya jaye emplyee : : setdata bhi do ho to kaise find krega function ya fir setdata aur setdata1 krke bnana pdega ....? please reply.
#include using namespace std; class animal { private: char name; int id; float price; public: void setData(char n, int i, float p); void showData(){ cout
#include
using namespace std;
//Structure of class
class Animal{
//Private variables accessible only with the help of function.
private:
int leg, eyes, ears;
public:
int sound, speed;
void setData(int a1, int b1, int c1); // Declaration only
void getData()
{
cout
same as harry 🤣 good
Well try
😁👍
Sound ko bhi integer data type me rakha hai
Sound ko string ya character data type me rakhna chahiye tha
#include
using namespace std;
class animals{
private:
int eyes;
int legs;
int ears;
public:
int speed;
int voice;
void setdata(int a, int b, int c){
eyes=a;
legs=b;
ears=c;
}
void getdata(){
cout
Time Stamp - 14:59
#include
using namespace std;
class Students
{
private:
int roll_no;
string religion;
public:
string f_name;
int standard;
int age;
void setData(int r, string rel); // r stands for roll_no & rel stands for religion.
void getData()
{
cout
Thanks Gulshan you given me best example of classes and object
@@rajrai4294 Your Welcome 🤝🏻
Syntax error aayega brother 🙂
@@curiousritik4558 Bhai coding line me aaye ho syntax error ho ya koi bhi error ho wo toh tumko hi solve krna h
Dhyaan do toh sirf logic pe
Yha gulshan ne kitne badhiya logic se ye problem likha h
@@rajrai4294 accha
#include
#include
using namespace std;
class Student{
private:
int roll;
public:
string name;
int Class;
void setData(int r);// declared
void getData(){
cout
@Felix Enzo I've seen you commenting exactly like this in some other video as well...wtf boy
@Felix Enzo don't promote your stuff here like this, because 99% of people here don't have Gf.
hmm, helps in understanding better... thanks 😃👌👏👏
@@swaroop2518 That hurts 😂
@@swaroop2518 hahaa
class bank
{
private : float transection, loan;
public : int profit, loss;
} ;
You are the best Harry Bhai ...free online course provider ....😍🥰🥰
#include
using namespace std;
class animal{
private:
int age,height,length;
public:
string name,species;
void setdata(int a,int h, int l); //note:a,h,l are just 3 random variables we have used to signify that we will be using 3 integers.
void getdata(){
cout
Bahut achha lga mujhe, and concept are so easy to understand by watching it. 💯
Thanks Harry Bhai...
Kuch smjh ni aa rha tha aaj jake sara kuch clear hua hai ...
Coded Myself time : 14:50
#include
#include
using namespace std;
class animal{
private:
char gender;
int babbies;
public:
char name[50];
int legs;
int hands;
void setData(char, int);
void getData();
};
void animal :: setData(char gen, int bab){
gender = gen;
babbies = bab;
}
void animal :: getData(){
cout
Nice code bro 👍
would you please tell me, what is the use of strcpy(); ?
@@shreyamittal9152Strcpy(String Copy) function, is use to copy string into a variable.
Love from Bangladesh Harry Bhai 🇧🇩🇧🇩❤️
14:45
Here,the example of a class is car
It can have different properties like
- Brand
- Color
- Transmission
- Mileage
us
// Class 15:00
class Program{
private:
int age;
char qualification;
public:
char languages;
int projects_made;
int time_experience; // --> write this in years;
}
I got 88% marks in my midterm exam due to this playlist hoping best for the final....
Thanks ❤
Yes its great
yar muja tu samaj nahi a rahi
There are only 37 videos of this subject
Bro ur video are amazing outstanding but my exams are near kindly complete the course asap
the answer i was searching that why classes is used instead of structure is well explained here .
Q 1: Write a C++ function “addition” that will take two arguments “istVal” and “secVal” as integer
arguments and the function will add the values of “istVal” and “secVal” and return the result to
the calling statement in main function.
itna easy aap cmt me q puch rhi ho
@@usamasharjeel8532 for answer 😅🙃
@@prernaprerna4028 first time ⌚ sab kuch hard lagta hain 🙃🙃😕
#include
using namespace std;
class Sum{
public: int sum;
int add(int istVal, int secVal);
};
int Sum :: add(int istVal, int secVal){
sum= istVal + secVal;
return sum;
}
int main(){
Sum s;
cout
@@vritikapathare noice
Class avengers{
Public:
Int speed;
Int health;
Int fire;
Void attack() {
Int attack=speed+fire;
Cout
Thanks Harry bhaiya ji for this amazing course that is free of cost!
Don't know only few view of this outstanding lecture
Time Stamp - 14:50
#include
using namespace std;
class animal
{
private:
string Name;
string food;
public:
int legs;
int lifespan;
void setData(string a,string f);
void getData(){
cout
Enter the name of the animal
Dog
Enter the favourite food
Biscuits
How many legs they have
4
What is lifespan of dog
20
The name of the animal is dog
Loves to eat biscuits
Dog has 4 leags
The lifespan of dog is 20 Years
@@uditmehra5636 thanks bro for showing the output of the code
string requires header file right?
@@myth_snipe7737no its not required you can define string variables in c++ if you want to use string functions than the string.h header file required
@@unknownking798most welcome bro ❤
Main pichle 5 dino se aise languages doondh raha tha jo bahut tuff ho sikhne mein time lage baad mein mujhe mili c++ bhai ne use bhi easy bana diya 😢rona aa raha hai
you might be earning good ....
but here you are earning the blessings and good wishes of all struggling students who were looted by the paid training goons after expensive degree expanses and the poeple looted on the name of internship ....god bless. u dear .....keep it up
This tut boosted my confidence ❤❤
also me
short and to the point. Your videos saved a lot of time ..... Thanks for making such a great content......
Thanks
14:55
#include
using namespace std;
class animal{
private:
int areanum;
int sellingvalue;
public:
int population;
int speed;
void setdata(int sellingvalue,int areanum);
void getdata(){
cout
you made me poor to better coder.
Thank you harry bhai .... love you bhai
# include
using namespace std;
class animal{
private:
int love;
public:
int sound;
int legs;
void setdata(int a);
void showdata(){
cout
Jjj
Love 2
Sound 2
Legs 4
The value of love is 2
The value of sound is 2
The value of legs is 4
By default data private hi hota h😅
Very good sir.....
Ek request hai plzz data structures par bhi tutorial video bnaye.
you are the best teacher in the world
Time Stamp - 14:59
//Written By Pulastya
#include
using namespace std;
class Car{
private:
double cost_of_car;int dis,rto_num;
public:
string name; int model_num;
void setData(int a1,int b1,int c1);
void getData(){
cout
hey harry!
#include
using namespace std;
class animal
{
public :
string name,food;
void hello(string name,string food);
};
void animal :: hello(string name,string food){
cout
after watching lot of videos finally , i got the right one
Wonderful way of teaching...thanks harry bhaiya❤️
Hello kindly c++ kai projects bhi bananna jis tara python kai app nai banye the..... Jis mai sare c++ kai topics covers hojay.... Make projects for c++.
Thank u.
Heyy Sir make more videos as soon as possible..my exams will start from mid of march
+1
enjoy!!! :D
tera naukar h kya wo?
Ok
to padai karo to lecture bunk mat maro
Mid Sem Tests coming soon.. Please upload more videos soon. I've watched C playlist already. By the way, I love your content.
Yaar meri bhi
Midsam is very very soon
padhai likhai pr dhyan do
IAS YAS bano aur desh sambhalo
@@tasneemahmad7858 wah bhai roll numer hi lagaliya name me ?
@@uraniumgaming123 college walo ko google meet pr naam me yahi pattern chahiye
learning java was so damn helpful, it was a piece of cake!
Great explanation.your effort is awesome
challanged accepted sir ,
and your way of teaching is really very good , videos are short but cover every point of the topic . really very helpfull to learn C++ .
thank you sir
😊
class Room
{
public:
double length;
double breadth;
double height;
double calculateArea(){
return length * breadth;
} double calculateVolume(){
return length * breadth * height; }
};
why you are defining your area function here, its very hard to read here,
Where is private keyword???
#include
using namespace std;
class animal{
private:
string Tiger;
string Cheeta;
public:
string Cow;
string Goat;
void setdata(string Tig, string Che );
void getdata(){
cout
its cheetah
tiger and cheetah not printed in output
Such a grt Teacher & Grt Programmer
right
Thank you so much sir... Very helpful n amazing ❤️😁
Thoda aage piche karke dekhna pada
par atlst samj aagaya
Thank YOU !!!!!!!!! Bhaiya !!'🤪🤪🙏🙏
class Animal{
private:
string sound;
int number ; // all animals has different sound
public:
string colour,food;
void setdata(string so,int sp);
void getdata(){
cout
Task: 15:00
#include
using namespace std;
class animal{
private:
char name[20], color[20];
public:
void data();
void print();
};
void animal :: data(){
coutname;
coutcolor;
}
void animal :: print(){
cout
Sir, in a class, you explained private and public modifiers. But what are protected modifiers?
protected modifiers have properties of both public and private modifiers. You can inherite properties from a protected modifiers but it will still be private for the user.
in protected data members of one class can be accessed outside of the class that is in another class
@@maazsajid5742 *subclass or inherited class
Bhai thanks and plz make full course of C++ bhai plz and thanks a lot 🙏💕 I love u ❤️😘 from my heart you are my real brother 👦 really bhai
Harry SIR, i tried a example - 14:47
#include
#include
using namespace std;
class pen{
private : float price;
string ink_colour;
public :
void get_data()
{
coutprice;
coutink_colour;
}
void prn_data()
{
cout
Thank you so much Harry bhai for making this video and I will see you next time ❤️☺️
Class Students {
Private :
int mobileNo;
string address;
Public:
Int rollNo;
String name;
Void putdata(int mob , string addr);
Void showdata ()
{
Cout
Sister Baki program sahi hai but
mobile No, address ko cout karwa hi nahi
class Animals{
public:
int legs=4;
};
class dog:public Animals{
public:
int ear=2;
};
int main ()
{
dog d;
cout
harry sir your teaching is fabulous.. your explaination is so good..u r nice sir for coding.
//create a class
class Animal
{
public:
int a;
void out()
{
cout
# include
using namespace std;
class Fruit{
public:
string name;
string colour;
};
int main()
{
Fruit apple;
apple.name="Apple";
apple.colour="yellow";
cout
#include
#include
using namespace std;
// 14:57
class Animal
{
public:
string name,sound;
int speed;
void set_animal_data(string parm_name,string param_sound,int param_speed);
void get_animal_data();
};
void Animal :: set_animal_data(string param_name,string param_sound,int param_speed){
name = param_name;
sound = param_sound;
speed = param_speed;
}
void Animal :: get_animal_data(){
cout
get_animal_data function m cout nhi krna?? ?
Nikhil, here you use
in cpp . Can we use this because this is for c and in cpp there is alternate called
@@harshprajapat165 Yup! You can use it
@@prernaprerna4028 why bro get_animal_data function me he krna h
there is the only difference between structure and classes in cpp that is default access specifier:
In struct it is public and in class it is private.
Inheritance can be used in structures
class animal{
int eye;
string type;
string name;
int years;
};
Thank you for the video harry bhai..
your videos make this Lockdown productive for us
Sir aap kitne great ho sab khuch free de rakkha source code bhi ,,,, I like you sir ,,,
9:24 class function definition
#include
using namespace std;
class animal{
private:
string name,colour;
int age;
public:
string sound;
int cost;
void setdata(string a,string b,int c);
void getdata(){
cout
Nice Code!!! Keet it up dude..
bro we can make functions using struct
the only difference between struct and class is by default in struct variables are public whereas in class they are private.
And i think the inheritance feature also
adarsh mishra not only inheritance there are many class properties which you can see in prev-vedio or search about it. So bcoz of that all properties of class makes a huge diff between structure and class
No in structure we cannot define Functions, and the solution of this is class🤟🏼
If you are using struct in cpp than there us no difference in class or struct...... You can also use the concept of inheritance in struct .... Know your fact before talking
class animal {
private:
int bark;
public:
void setdata(int bark1)
int legs;
}
#include
using namespace std;
class Employee{
int salary;
public:
int id;
string name;
void setdata(int x);
void getdata(){
cout
People says best of luck for exams... And i say jab code with harry hai sath to darnai ki kya baat
If we don't declare access modifier to any variable and function by default it get private.
#include
using namespace std;
class person
{
public:
string name;
int age;
int height;
int weight;
void getdata()
{
cin>>name>>age>>height>>weight;
}
void talk()
{
cout
Could we get some questions for this chapter?
Thanks Bhaiya
Thankuuuu very much sir love u from pak 💛
sir if we write those functions under private as you have written them under public can we use them in main program??
nope
@@revanthkumar1789 No bro
#include
using namespace std;
class vehicle
{
private:
int id;
public:
string model;
void setter(int i, string m)
{
id=i;
model=m;
}
void getter()
{
cout
Answer of the animal class:
#include
using namespace std;
class animal{
private: string name,sound,family;
public: int legs,age;
void setdata( string name1,string sound1,string family1, int legs1, int age1);
void getdata(){
cout
# include
using namespace std;
class student
{
private:
string religion;
string gender;
public:
string name;
int roll_no;
void setdata(string religion , string gender ){
cout
#include
using namespace std;
class Rectangle
{
private:
int length, width, area, peri;
public:
void SetDimensions(int l, int b);
void CalculateArea();
void CalculatePerimeter();
};
void Rectangle ::SetDimensions(int l, int b)
{
length = l;
width = b;
}
void Rectangle ::CalculateArea()
{
area = length * width;
cout
Class animal {
Private:
Int eye, hand;
Public:
Int leg;
Void setData(Int a, Int b);
Void getData(){
Cout
Wah 👏👏👏👏👏
Bro ther private na likho toh bhi automatically private hi rehta 🌝
Nice bro
Easy to Explain
Upload next video 😍
Dear sir,
Void employee :: setdata(int a,int b,int c)
{
a=a1;// a= a1 karne se kya hua?
b=b1;
C=c1;
}
Isse aage jo main me set deta me jo value dali 1,2,4 usko a,b,c me dalne k liy ye function bnaya h 🤗
Syntax galat likha h aap ne
setdata(int a1,int b1, int c1) hoga .
Badd mai jab main () mai jab user input daalega wo a1 , b1, c1 mai store hoga fhir uske value a, b, c mai chale jayege.
Fhir cout
Love from PAK whole university know you sir almost
Sir, is this similar to structure in c??
Lil bit different brother
class Player {
public:
string name;
string favGame;
int age;
void changeFavGame(string gameName){
cout
Just a small correction, access modifiers exist in structures also
and also structures in c++ allows function definition inside the structure
void class name::function name(arguments);
#include
#include
using namespace std;
class Animal
{
private:
string name;
public:
string colour, bread;
void setData(string name, string colour, string bread);
void showData()
{
cout
*breed
12:36 so that's like function prototyping right? We pre-declare a function call and then define the said function later.
Sir, Are the content(variables + functions) written in the public category up to the end of the class '}' is considered as public or it gets terminated after the semicolon; at the end of the next line where public was written?
All the variable or function can be written either in private or in public depending on your choice or situation.
doesn't get terminated after; but terminated or we can say considered up to }
class student{
float percentage;
int roll no.;
public:
char* name[20], section;
};
I think u should define something as private after that in public.
Vaiya next videos Kab ayega?
Thodi jaldi kro 🙏🙏🙏🙏
class addtion
{
private:
int a ,b;
public:
void setdata(int a ,int b);
void getdata();
};
Harry bhai can we use "void setData and getData" for public function
plz reply I am waiting for your reply
Functions are created for private use only... Set data... Is used bcoz we want to access the private variables through function... And get data is jst to print it.. To access the public variable we don't need functions we can directly access it.. By using dot..
12:30 set data ko aage define krne ka tarika to bata dia but get data ko agar aage define krna ho to kaise krenge??
#include
using namespace std;
class animal
{public :
string name;
float size;
int speed;
void setData(string x_name, float x_size, int x_speed);
void getData(){
cout
time space - 14:59
#include
#include
using namespace std;
class TATA
{
private:
int car_number;
string name;
public:
string c_name; // c declar for a car
string type;
float price;
float speed;
float weight;
void cardetails(int number,string a);
void getdata(){
cout
Sir please design a cource for visual programming with c# i direly need it. You are the only one person to whom i can understand.
Please sir upload this cource i shall be very thankful to you.
#include
using namespace std;
class Employee
{
private:
int salary, pts;
public:
int experience;
string name ;
void setData(int _salary,int _pts);
void getData();
};
void Employee :: setData(int _salary, int _pts){
salary=_salary;
pts = _pts;
}
void Employee :: getData(){
cout
👏Great
#include
using namespace std;
class animal
{
private :
string animal_name,type;
public :
int speed;
void setdata(string animal_name1, string type1);
void getdata(){
cout
13:10 aapne pehle btaya tha ki template same ho to koi frk nhi pdta..is case me age do employee class bna diya jaye emplyee : : setdata bhi do ho to kaise find krega function ya fir setdata aur setdata1 krke bnana pdega ....? please reply.
#include
using namespace std;
class animal
{
private:
char name;
int id;
float price;
public:
void setData(char n, int i, float p);
void showData(){
cout
#include
using namespace std;
class animalSound{
private:
string s1,s2,s3;
public:
string s4,s5;
void setSound(string a, string b, string c);
void getSound(){
cout
almost sahi lag rha hai bhai