C++ constructors (#22) 👷

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024

Комментарии • 11

  • @BroCodez
    @BroCodez  4 года назад +3

    #include
    #include
    #include
    using namespace std;
    class Human {
    public:
    string name;
    int age;
    double weight;
    Human(string name,int age,double weight) {
    this->name = name;
    this->age = age;
    this->weight = weight;
    }
    };
    int main()
    {
    //constructor = special function that is automatically called when an object is instantiated
    //useful for assigning arguments to variables
    Human human1("Rick",65,80);
    Human human2("Morty", 16, 60);
    Human human3("Jerry", 45, 85);

    cout

    • @Code_Life_
      @Code_Life_ 3 года назад +1

      thanx for that code i love your videos pls make some advance c++ videos that functions or libraries we never seen before in our life

  • @komailbutt7980
    @komailbutt7980 2 года назад +1

    Sir u r an amazing teacher. Pls continue the series of OOP in C++.

  • @akshayshah7008
    @akshayshah7008 2 года назад +1

    Continue the series bro!!!

  • @solace895
    @solace895 3 года назад +1

    LinearEq(double slope, double y_intercept, double x){
    this->slope = slope;
    this->y_intercept = y_intercept;
    this->x = x;
    }

  • @hurried_coder404
    @hurried_coder404 2 года назад

    So underrated

  • @facuconti6692
    @facuconti6692 3 года назад

    Nice video, bro!

  • @onurguzel16
    @onurguzel16 2 года назад

    We love you Bro :)

  • @girl6994
    @girl6994 4 года назад +1

    Sir,I really missed you. Because you have been 4 days no any video

  • @kavyakavya1605
    @kavyakavya1605 8 месяцев назад

    Hello bro I have problem I don't know how to solve it
    Program - write a program uing constructer to print "I love programming" and if user enter any "string" programing should be replaced by the entered string.
    If anyone know how to write this program pls help

  • @Diamond_Hanz
    @Diamond_Hanz 4 года назад

    The BRO CODE!!!! BROS BEFORE THOTs! heh..