C++ Introduction to classes [1]

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

ความคิดเห็น • 25

  • @singler999
    @singler999 21 ชั่วโมงที่ผ่านมา

    When you were at the moment of a fuinction definition approximately starting at 3:30 you commented and called your definition as a declaration, some people might get confused as I am, so for people outhere:
    Declaration is when you basically call a function with or without its arguments and a definition of a function is where the actual calculation going on, basically it describes the function within its body

  • @mosquito8192
    @mosquito8192 หลายเดือนก่อน

    Thank you so much for making this video! Classes were super confusing to me until you explained it!

  • @ALS1970
    @ALS1970 2 หลายเดือนก่อน

    Like his soft voice teaching stile, helps me remember stuff and follow easy.

  • @lorddoinkus6349
    @lorddoinkus6349 ปีที่แล้ว +1

    Classes have always given me trouble. I've always veered towards structs as a result. This series has cleared up any confusion I've had regarding classes and now I feel comfortable using them now

  • @treyandrews201
    @treyandrews201 ปีที่แล้ว +1

    I've commented on a previous video but I just wanted to reiterate it here. Thank you for making these videos! The way you explain things is easier for me to understand

  • @leythecg
    @leythecg ปีที่แล้ว +2

    Just great content! Many thanks!

    • @ProfessorHankStalica
      @ProfessorHankStalica  ปีที่แล้ว +1

      Wow, thanks for the comment! Glad you found it useful. Welcome!

  • @MondestinJeune
    @MondestinJeune ปีที่แล้ว +1

    Thank you times a million Professor!

  • @qcnck2776
    @qcnck2776 ปีที่แล้ว +1

    At 5:49 you say that instantiation creates an object in memory. This is something that I find confusing.
    What exactly is being created, and how much memory is being allocated? Does the program allocate memory for all of the variables of that class (public or private) when an object is instantiated?

    • @ProfessorHankStalica
      @ProfessorHankStalica  ปีที่แล้ว +3

      That is a great question and I'm sorry I didn't do a better job explaining that.
      You know when you define a variable and memory gets allocated with the definition? That's what's happening when you instantiate a class.
      Instantiation is just taking a class, which is like a blueprint, and then creating the object in memory. The object is just the representation of the class in actual memory.
      Kind of like when you say
      int x;
      you've sort of, kind of, instantiated an int variable.
      So, as far as how much memory is being allocated? That depends. Depends on how many member variables you declare in your class declaration and, to a certain extent, how much the compiler optimizes it.
      That said, you can use sizeof on a class to find get an idea.
      For example, sizeof(Rectangle).

    • @qcnck2776
      @qcnck2776 ปีที่แล้ว +1

      @@ProfessorHankStalica Thank you so much for this thorough explanation. And the hint about using sizeof().
      Always enjoy your videos

  • @bashiraddean-mufarreh
    @bashiraddean-mufarreh ปีที่แล้ว +1

    let's set out with oop . thanks prof Hank

  • @joey6047
    @joey6047 ปีที่แล้ว +1

    Nice beard bro. I have a question for you. Did you think Tim Lincecum is a hall of famer?

  • @jamesmasonic
    @jamesmasonic 26 วันที่ผ่านมา

    Hello! Thanks for great lectures. I want to follow step by step. Do you have a list for these C++ lectures in order? I cannot find in playlists section.

    • @ProfessorHankStalica
      @ProfessorHankStalica  24 วันที่ผ่านมา

      In the playlists section, just go through each of the chapter playlists in order. Begin with chapter 2.

  • @Impulse_Photography
    @Impulse_Photography 2 หลายเดือนก่อน

    The question I have is simple, I'm sure.
    Q.) When would I use a class, and when should I just use functions in my main ??

    • @ProfessorHankStalica
      @ProfessorHankStalica  2 หลายเดือนก่อน

      The answer is simple, but frustrating: it depends. How you design something and implement that design will be driven by the needs of a particular project.
      But one quick example is performance. A program that needs to maximize performance might be better suited to be implemented only using functions.
      Another quick example is if you are trying to model real world entities, then you want to go OOP. That's because each class can represent the real-world thing (such as a car, or instrument panel) more easily.

  • @bashiraddean-mufarreh
    @bashiraddean-mufarreh ปีที่แล้ว +1

    Hi prof. I am making projects based on what I learned from your channel and I want you to see them. To you see what I learned from you. How do I send it to you! If you like to see it of course.

    • @ProfessorHankStalica
      @ProfessorHankStalica  ปีที่แล้ว +2

      I'd like to, but I don't have the bandwidth to review everyone's projects. =( Why not share it in the message board?

    • @bashiraddean-mufarreh
      @bashiraddean-mufarreh ปีที่แล้ว

      @@ProfessorHankStalica You mean that I put it here as a comment?

    • @ProfessorHankStalica
      @ProfessorHankStalica  ปีที่แล้ว +2

      @@bashiraddean-mufarreh You could post under the community section. When you go to my channel at the top there are options: Home, Videos, Live, Playlists, Community, Membership, Channels. Pick Community and you can make posts there.

  • @takethepillingodwetrust1510
    @takethepillingodwetrust1510 ปีที่แล้ว +1

    Yoo I go to DVC for cs :)