Classes, Public and Private access modifiers in C++ | C++ Tutorials for Beginners #21

Sdílet
Vložit
  • čas přidán 5. 02. 2020
  • ►Source Code & Resources: codewithharry.com/videos/cpp-...
    ►This video is a part of my C++ playlist: • C++ Tutorials In Hindi
    ►For Doubt Solving, Brain Storming Sessions & guaranteed replies, join the channel membership here: / @codewithharry
    ►Click here to subscribe - / @codewithharry
    ►Checkout my English channel here: / programmingwithharry
    Best Hindi Videos For Learning Programming:
    ►Learn Python In One Video - • Python Tutorial In Hin...
    ►Python Complete Course In Hindi - • Python Tutorials For A...
    ►C Language Complete Course In Hindi -
    • C Language Tutorials I...
    ►JavaScript Complete Course In Hindi -
    • JavaScript Tutorials I...
    ►Learn JavaScript in One Video - • JavaScript Tutorial
    ►Learn PHP In One Video - • Learn Php In One Video...
    ►Django Complete Course In Hindi -
    • Python Django Tutorial...
    ►Machine Learning Using Python - • Machine Learning Tutor...
    ►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
    ►Advanced Python Tutorials - • Intermediate/Advanced ...
    ►Object Oriented Programming In Python - • Object Oriented Progra...
    ►Python Data Science and Big Data Tutorials - • Python Data Science an...
    Follow Me On Social Media
    ►Website (created using Flask) - www.codewithharry.com
    ►Facebook - / codewithharry
    ►Instagram - / codewithharry
    ►Personal Facebook A/c - / geekyharis
    Twitter - / haris_is_here

Komentáře • 962

  • @blackopss017
    @blackopss017 Před rokem +252

    #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

    • @FB_TECHS
      @FB_TECHS Před rokem +9

      same as harry 🤣 good

    • @vedantkokate82
      @vedantkokate82 Před rokem +4

      Well try

    • @ArPiTNooB
      @ArPiTNooB Před rokem +2

      😁👍

    • @julfekar7564
      @julfekar7564 Před 4 měsíci +2

      Sound ko bhi integer data type me rakha hai
      Sound ko string ya character data type me rakhna chahiye tha

    • @Bloodflood
      @Bloodflood Před 3 dny

      #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

  • @imgullu
    @imgullu Před rokem +245

    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

    • @rajrai4294
      @rajrai4294 Před rokem +19

      Thanks Gulshan you given me best example of classes and object

    • @imgullu
      @imgullu Před rokem +11

      @@rajrai4294 Your Welcome 🤝🏻

    • @curiousritik4558
      @curiousritik4558 Před rokem +6

      Syntax error aayega brother 🙂

    • @rajrai4294
      @rajrai4294 Před rokem +21

      @@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

    • @curiousritik4558
      @curiousritik4558 Před rokem +2

      @@rajrai4294 accha

  • @nikhilsrivastava311
    @nikhilsrivastava311 Před 4 lety +392

    #include
    #include
    using namespace std;
    class Student{
    private:
    int roll;
    public:
    string name;
    int Class;
    void setData(int r);// declared
    void getData(){
    cout

    • @laxus7764
      @laxus7764 Před 3 lety +9

      @Felix Enzo I've seen you commenting exactly like this in some other video as well...wtf boy

    • @swaroop2518
      @swaroop2518 Před 3 lety +14

      @Felix Enzo don't promote your stuff here like this, because 99% of people here don't have Gf.

    • @Pianissimo311
      @Pianissimo311 Před 3 lety +4

      hmm, helps in understanding better... thanks 😃👌👏👏

    • @goodcake05
      @goodcake05 Před 3 lety +1

      @@swaroop2518 That hurts 😂

    • @cse080chandrasekhar9
      @cse080chandrasekhar9 Před 3 lety

      @@swaroop2518 hahaa

  • @kumarrajneesh2321
    @kumarrajneesh2321 Před 4 lety +13

    Bahut achha lga mujhe, and concept are so easy to understand by watching it. 💯

  • @mystudiobeats8440
    @mystudiobeats8440 Před 4 lety +14

    You are the best Harry Bhai ...free online course provider ....😍🥰🥰

  • @cod-phy1646
    @cod-phy1646 Před 2 lety +22

    Wonderful way of teaching...thanks harry bhaiya❤️

  • @manmeetsinghkhalsa2077
    @manmeetsinghkhalsa2077 Před rokem +6

    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

  • @vikrantgodbole1181
    @vikrantgodbole1181 Před rokem +73

    # include
    using namespace std;
    class animal{
    private:
    int love;
    public:
    int sound;
    int legs;
    void setdata(int a);
    void showdata(){
    cout

  • @theevi1350
    @theevi1350 Před 3 lety +4

    Thanks Harry Bhai...
    Kuch smjh ni aa rha tha aaj jake sara kuch clear hua hai ...

  • @devanshusahoo
    @devanshusahoo Před 2 lety +9

    #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

  • @jersingh6837
    @jersingh6837 Před 11 měsíci +3

    Thanks Harry bhaiya ji for this amazing course that is free of cost!

  • @aiexplorations-cv1js
    @aiexplorations-cv1js Před rokem +10

    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

    • @jivangaming
      @jivangaming Před 11 měsíci +2

      Nice code bro 👍

    • @shreyamittal9152
      @shreyamittal9152 Před 10 měsíci +1

      would you please tell me, what is the use of strcpy(); ?

    • @aiexplorations-cv1js
      @aiexplorations-cv1js Před 10 měsíci +1

      @@shreyamittal9152Strcpy(String Copy) function, is use to copy string into a variable.

  • @spoorthi6065
    @spoorthi6065 Před 3 lety +7

    Thank you so much sir... Very helpful n amazing ❤️😁

  • @LokeshSharma-hm5jz
    @LokeshSharma-hm5jz Před rokem +25

    short and to the point. Your videos saved a lot of time ..... Thanks for making such a great content......

  • @dipesh-singla
    @dipesh-singla Před 4 lety +13

    Bro ur video are amazing outstanding but my exams are near kindly complete the course asap

  • @CodingGem
    @CodingGem Před 11 měsíci +70

    I got 88% marks in my midterm exam due to this playlist hoping best for the final....
    Thanks ❤

  • @defencofinishers3276
    @defencofinishers3276 Před 3 lety +6

    after watching lot of videos finally , i got the right one

  • @allfacts1331
    @allfacts1331 Před 2 lety +4

    Thank you so much Harry bhai for making this video and I will see you next time ❤️☺️

  • @AbdullahKhan-hu8fo
    @AbdullahKhan-hu8fo Před rokem +2

    Great explanation.your effort is awesome

  • @18aadi70
    @18aadi70 Před 2 lety +7

    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

  • @saurabhpandey2018
    @saurabhpandey2018 Před 3 lety +15

    This tut boosted my confidence ❤❤

  • @kaminijain5544
    @kaminijain5544 Před 2 lety +8

    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

  • @csssatyamjadhav7681
    @csssatyamjadhav7681 Před 3 lety +9

    Thank you for the video harry bhai..
    your videos make this Lockdown productive for us

  • @a_12_nileshchaudhari14
    @a_12_nileshchaudhari14 Před 3 lety +4

    Don't know only few view of this outstanding lecture

  • @shaikhfaizan6233
    @shaikhfaizan6233 Před 2 lety +12

    harry sir your teaching is fabulous.. your explaination is so good..u r nice sir for coding.

  • @surendrakashyap4859
    @surendrakashyap4859 Před 4 lety +18

    Very good sir.....
    Ek request hai plzz data structures par bhi tutorial video bnaye.

  • @RahulRahul-qj5bv
    @RahulRahul-qj5bv Před rokem +1

    you made me poor to better coder.
    Thank you harry bhai .... love you bhai

  • @AmarKumar-iz8gy
    @AmarKumar-iz8gy Před rokem +1

    the answer i was searching that why classes is used instead of structure is well explained here .

  • @sumanjain957
    @sumanjain957 Před 11 měsíci +4

    learning java was so damn helpful, it was a piece of cake!

  • @adityaagarwal3398
    @adityaagarwal3398 Před 4 lety +3

    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

  • @rajmanipandey3999
    @rajmanipandey3999 Před 11 měsíci +1

    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

  • @__ajaymath6585
    @__ajaymath6585 Před rokem +17

    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
    😊

  • @sufiyanmogal1527
    @sufiyanmogal1527 Před rokem +10

    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

    • @uditmehra5636
      @uditmehra5636 Před rokem +1

      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

    • @sufiyanmogal1527
      @sufiyanmogal1527 Před rokem +1

      @@uditmehra5636 thanks bro for showing the output of the code

    • @myth_snipe7737
      @myth_snipe7737 Před 11 měsíci

      string requires header file right?

    • @sufiyanmogal1527
      @sufiyanmogal1527 Před 11 měsíci

      ​​​@@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

    • @sufiyanmogal1527
      @sufiyanmogal1527 Před 11 měsíci

      ​@@unknownking798most welcome bro ❤

  • @Noobra01
    @Noobra01 Před rokem +2

    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

  • @NowThatsCool
    @NowThatsCool Před 3 lety +1

    Thank you ,much appreciated

  • @taleofkaran
    @taleofkaran Před 4 lety +96

    Mid Sem Tests coming soon.. Please upload more videos soon. I've watched C playlist already. By the way, I love your content.

  • @sandeep_cse_3231
    @sandeep_cse_3231 Před 3 lety +12

    class bank
    {
    private : float transection, loan;
    public : int profit, loss;
    } ;

  • @GeekyShubhamSharma
    @GeekyShubhamSharma Před 4 lety

    Lovely teaching awesome Harry bhai

  • @umarafzal8009
    @umarafzal8009 Před 4 měsíci +1

    you are the best teacher in the world

  • @pulastyabhagwat7774
    @pulastyabhagwat7774 Před 10 měsíci +4

    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

  • @bestedmmusic512
    @bestedmmusic512 Před 4 lety +10

    Nice bro
    Easy to Explain
    Upload next video 😍

  • @Forever._.curious..
    @Forever._.curious.. Před 3 lety +1

    Great thanx
    It went so easy ;

  • @ishanmathur447
    @ishanmathur447 Před 2 lety +2

    #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

  • @Forever._.curious..
    @Forever._.curious.. Před 3 lety +9

    Such a grt Teacher & Grt Programmer

  • @vaibhav3214
    @vaibhav3214 Před 2 lety +3

    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

  • @abhaysangwan483
    @abhaysangwan483 Před rokem +1

    Thanks a lot sir,it is a great content❤

  • @mdmuquimakhter5145
    @mdmuquimakhter5145 Před rokem

    Dil se Thank you Harry bhai

  • @nafisahmed3607
    @nafisahmed3607 Před 2 lety +5

    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

  • @AzeemKhan-sr4my
    @AzeemKhan-sr4my Před 4 lety +15

    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.

  • @sorcerer_13.19
    @sorcerer_13.19 Před 2 lety

    Luv you bro.. maza aa jaata hai aap se padh kar..

  • @Anurag-fk3op
    @Anurag-fk3op Před 6 měsíci

    Class avengers{
    Public:
    Int speed;
    Int health;
    Int fire;
    Void attack() {
    Int attack=speed+fire;
    Cout

  • @skillslogo
    @skillslogo Před rokem +6

    #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

  • @nikhilraj1842
    @nikhilraj1842 Před 4 lety +77

    #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

    • @prernaprerna4028
      @prernaprerna4028 Před 2 lety

      get_animal_data function m cout nhi krna?? ?

    • @harshprajapat165
      @harshprajapat165 Před 2 lety +1

      Nikhil, here you use
      in cpp . Can we use this because this is for c and in cpp there is alternate called

    • @nikhilraj1842
      @nikhilraj1842 Před 2 lety

      @@harshprajapat165 Yup! You can use it

    • @mohdfarman5287
      @mohdfarman5287 Před 2 lety

      @@prernaprerna4028 why bro get_animal_data function me he krna h

  • @shashankbhosagi
    @shashankbhosagi Před 2 lety

    Thoda aage piche karke dekhna pada
    par atlst samj aagaya
    Thank YOU !!!!!!!!! Bhaiya !!'🤪🤪🙏🙏

  • @devhunk
    @devhunk Před 4 lety +2

    Thankuu sir.... 🥰

  • @piyushdixit6353
    @piyushdixit6353 Před 4 lety +98

    Heyy Sir make more videos as soon as possible..my exams will start from mid of march

  • @sandeeppareek8941
    @sandeeppareek8941 Před 4 lety +10

    #include
    #include
    #include
    using namespace std;
    class animal
    {

    public:
    string name, colour;
    string legs, speed;
    void num_getdata(void);
    void getdata(void);
    void showdata()
    {
    cout

  • @karanchouhan2247
    @karanchouhan2247 Před 2 lety +1

    Thank bhiya for this valuable tutorial

  • @tauhidalam.
    @tauhidalam. Před 3 měsíci +1

    #include
    using namespace std;
    class function
    {
    private:
    int a,b,c;
    public:
    int d,e;
    void setdata(int a1,int b1,int c1);//Declaretion
    void getdata(){
    cout

  • @sakshi9119
    @sakshi9119 Před 3 lety +3

    9:24 class function definition

  • @30vaibhavdhaygondexdr.v.sa22

    // Class 15:00
    class Program{
    private:
    int age;
    char qualification;
    public:
    char languages;
    int projects_made;
    int time_experience; // --> write this in years;
    }

  • @utsavseth6573
    @utsavseth6573 Před rokem

    very good explaination.

  • @shravankumarpandey108
    @shravankumarpandey108 Před 2 měsíci +2

    #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

  • @Pianissimo311
    @Pianissimo311 Před 3 lety +57

    Sir, in a class, you explained private and public modifiers. But what are protected modifiers?

    • @apurbakumarmajumder9478
      @apurbakumarmajumder9478 Před 2 lety +28

      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.

    • @maazsajid5742
      @maazsajid5742 Před 11 měsíci

      in protected data members of one class can be accessed outside of the class that is in another class

    • @goodvibes7304
      @goodvibes7304 Před 6 měsíci

      @@maazsajid5742 *subclass or inherited class

  • @almasnazakat4363
    @almasnazakat4363 Před 3 lety +17

    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.

    • @usamasharjeel8532
      @usamasharjeel8532 Před 3 lety +2

      itna easy aap cmt me q puch rhi ho

    • @prernaprerna4028
      @prernaprerna4028 Před 2 lety +2

      @@usamasharjeel8532 for answer 😅🙃

    • @rpw2k23
      @rpw2k23 Před 2 lety +3

      @@prernaprerna4028 first time ⌚ sab kuch hard lagta hain 🙃🙃😕

    • @vritikapathare
      @vritikapathare Před 2 lety +17

      #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

    • @sumitraj6878
      @sumitraj6878 Před rokem

      @@vritikapathare noice

  • @corashidshaikh2890
    @corashidshaikh2890 Před 2 lety +1

    Thx great video..❤️

  • @muhammadareebkazmi9476

    Thank you, Harry bhai!

  • @nishumittal4277
    @nishumittal4277 Před 2 lety +6

    If we don't declare access modifier to any variable and function by default it get private.

  • @ravalsinhal8078
    @ravalsinhal8078 Před 10 měsíci

    Thank you very much sirji 🙏🏻🙏🏻

  • @avinashkumawat4904
    @avinashkumawat4904 Před 3 lety +1

    Pura khol ke rakh diya😍

  • @jagannathbiswas
    @jagannathbiswas Před 2 lety +4

    Could we get some questions for this chapter?

  • @sarthakvats1634
    @sarthakvats1634 Před 2 lety +22

    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?

    • @harshprajapat165
      @harshprajapat165 Před 2 lety

      All the variable or function can be written either in private or in public depending on your choice or situation.

    • @qqqppp11
      @qqqppp11 Před 2 lety

      doesn't get terminated after; but terminated or we can say considered up to }

  • @kalpendrayadav2450
    @kalpendrayadav2450 Před rokem

    Thank you so much sir 😊😃💝

  • @suhashisumanshukla2779
    @suhashisumanshukla2779 Před 3 lety +8

    class Room
    {
    public:
    double length;
    double breadth;
    double height;
    double calculateArea(){
    return length * breadth;
    } double calculateVolume(){
    return length * breadth * height; }
    };

    • @Gangbuster74
      @Gangbuster74 Před 3 lety

      why you are defining your area function here, its very hard to read here,

    • @shikhargupta8759
      @shikhargupta8759 Před 3 lety

      Where is private keyword???

  • @princemishra3549
    @princemishra3549 Před 3 lety +15

    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.

  • @jkhan7713
    @jkhan7713 Před 3 lety

    Thank you sir bht bht shukriya♥️♥️♥️♥️

  • @hardikchawhan6346
    @hardikchawhan6346 Před rokem +2

    #include
    using namespace std;
    class Animal
    {
    private:
    int a, b, c;
    public:
    int d, e;
    void setData(int a1, int b1, int c1);
    void getData(){
    cout

  • @MNTNMX
    @MNTNMX Před rokem +5

    #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

  • @shivam_poddar
    @shivam_poddar Před 4 lety +8

    #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

  • @gopalchavan8806
    @gopalchavan8806 Před rokem

    Thank you bhai... ❤

  • @samirkumarmajhi4749
    @samirkumarmajhi4749 Před rokem

    great course harry

  • @muskangupta6534
    @muskangupta6534 Před 3 lety +3

    Class Students {
    Private :
    int mobileNo;
    string address;
    Public:
    Int rollNo;
    String name;
    Void putdata(int mob , string addr);
    Void showdata ()
    {
    Cout

    • @hassanjaveed2168
      @hassanjaveed2168 Před rokem

      Sister Baki program sahi hai but
      mobile No, address ko cout karwa hi nahi

  • @adarshsinghfit837
    @adarshsinghfit837 Před 2 lety +3

    #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

  • @anuragthakur0724
    @anuragthakur0724 Před rokem

    Thank you! 😇

  • @atharvpatharkar1652
    @atharvpatharkar1652 Před 3 lety +1

    Thank You 🙏🏻

  • @___vijay___
    @___vijay___ Před 3 lety +7

    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.

    • @adarshmishra8198
      @adarshmishra8198 Před 3 lety

      And i think the inheritance feature also

    • @ajayjangid1164
      @ajayjangid1164 Před 3 lety

      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

    • @ajayjangid1164
      @ajayjangid1164 Před 3 lety

      No in structure we cannot define Functions, and the solution of this is class🤟🏼

    • @waise_otaku665
      @waise_otaku665 Před 2 lety

      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

  • @khushaalsharma
    @khushaalsharma Před 2 lety +6

    sir if we write those functions under private as you have written them under public can we use them in main program??

  • @royfamily9273
    @royfamily9273 Před 2 lety

    Thanks Harry Bhaiya

  • @apurvasonawane5049
    @apurvasonawane5049 Před 2 lety

    Thank you Harry bhaii!🥳

  • @sumanpal4787
    @sumanpal4787 Před 4 lety +4

    Vaiya next videos Kab ayega?
    Thodi jaldi kro 🙏🙏🙏🙏

  • @mayankagarwal8026
    @mayankagarwal8026 Před 2 lety +5

    #include
    using namespace std;
    class animal
    {
    private :
    string animal_name,type;
    public :
    int speed;
    void setdata(string animal_name1, string type1);
    void getdata(){
    cout

  • @NASA..videos
    @NASA..videos Před 2 lety +1

    Thankuuuu very much sir love u from pak 💛

  • @0008Arif
    @0008Arif Před 4 lety +1

    Sir thanks for these videos

  • @ujwalkumar2374
    @ujwalkumar2374 Před 2 lety +15

    Just a small correction, access modifiers exist in structures also

    • @user-zo9ye6de5e
      @user-zo9ye6de5e Před 2 lety +4

      and also structures in c++ allows function definition inside the structure

  • @yashvantjadhav5713
    @yashvantjadhav5713 Před 3 lety +3

    Harry bhai can we use "void setData and getData" for public function
    plz reply I am waiting for your reply

    • @sougata_paul
      @sougata_paul Před 3 lety +4

      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..

  • @venerate777
    @venerate777 Před rokem +2

    Sir jab ham koi program run karte hai, tab compiler sabse pehele program ke konse part me jata hai ??

  • @deepspace820
    @deepspace820 Před rokem +2

    # include
    using namespace std;
    class student
    {
    private:
    string religion;
    string gender;
    public:
    string name;
    int roll_no;
    void setdata(string religion , string gender ){
    cout

  • @LokeshSharma-bf2cj
    @LokeshSharma-bf2cj Před 2 lety +7

    Sir, is this similar to structure in c??

  • @zeeshanhaider9092
    @zeeshanhaider9092 Před 4 lety +4

    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.

  • @hammadtufailjhujh6542

    Love from PAK whole university know you sir almost