C++ Create Your Own Class Header Files [2]

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

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

  • @eduardogallegos9
    @eduardogallegos9 ปีที่แล้ว +9

    You are an amazing teacher. Thank you! I wish you were my professor

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

      Who am I to argue with someone with such obvious intelligence?

    • @errik96
      @errik96 ปีที่แล้ว

      Me too!! Very easy to understand and speaks very clearly!!@@ProfessorHankStalica

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

    thank you for explaing macros in a proper manner

  • @mr.shredder5430
    @mr.shredder5430 ปีที่แล้ว +1

    thanks for making this tutorial it help me alot, i hope others may benefit from it, its a lot to learn i hope you keep teaching 💜💜

  • @MrMichalXXL
    @MrMichalXXL ปีที่แล้ว

    What a great video. It helped a lot

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

    Sir one question, sir instead of making two different files that is specification and implementation can we make one that is only the rectangle.cpp and add just that in the main. cpp? What will be the differences in this case and can we use the same logic of preprocessors that we used in the rectangle.h in this case?
    I mean to say everything including the class and member function definitions in the rectangle.cpp and only including this in the main file and not create the rectangle.h at all?

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

      You absolutely could. Just throw everything into a .h file and #include that. It's purely preference and how close to some standards you want to follow.

    • @sayanhalder6470
      @sayanhalder6470 ปีที่แล้ว

      ​@@ProfessorHankStalicasir dp u have a vdo on iostream file, the stream concept is very complex for me and specily the > operator. I have problems specifically when we use the operaror overloading comcept with the extractipn operaror where we treat the cout as an operand and object along with ostream as the class. I have problems regarding the iostream classes and understanding the objects of them specifically

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

      @@sayanhalder6470 I think this might be what you are looking for: th-cam.com/video/YHI5xamiheA/w-d-xo.html
      Don't forget that TH-cam channels have a search function. Go to the channel landing page www.youtube.com/@ProfessorHankStalica and next to the About link is an hour glass. Click that and you can search the channel for whatever you are interested in. You can also click the Playlists link to scan through that too.

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

      @@ProfessorHankStalica ah Thanks!! i was looking for this. I was wandering if I could declare and define all in the header file.

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

    hello professor how to run this on Visual Studio thank you.

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

      Hi, not sure I understand the question since I use Visual Studio in the video.

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

    Great stuff 🙂

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

    Hello, professor Hank! I'm a little confused why does it have to be this way in C++, implementation and specification files. To me, it would make more sense to have a class in a file altogether and import that in the main file.

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

      It doesn't have to be this way. You could put them all in the same header file, but this is an option and common practice.

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

    professor is there any assignment that would help us in each lesson ? and THANKS FOR YOUR EFFORT

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

      Yes, but to see them, you need to be in my class and you are welcome.

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

      @@ProfessorHankStalica how is thay possible ?

  • @AsmmaaMAhHmmeed
    @AsmmaaMAhHmmeed ปีที่แล้ว

    Thank you so much ❤❤❤❤❤❤❤

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

    Really great video

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

    After creating a header file, what is the best way to use it in another project? Do I just need to create a new header file and copy and paste the code over each time?

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

      No, you place it in a folder that's in the path for your IDE and then you can just #include "yourheader.h"

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

    '#pragma once' is not limited to Windows compilers and is supported by most modern C++ compilers across different platforms.
    Supported Compilers:
    GCC (GNU Compiler Collection): Fully supports '#pragma once'
    Clang: Fully supports '#pragma once'
    MSVC (Microsoft Visual C++): Fully supports '#pragma once'
    Intel C++ Compiler: Supports '#pragma once'
    Apple's Xcode (using Clang): Supports '#pragma once'

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

      Supported, but not standard and not always reliable.
      en.wikipedia.org/wiki/Pragma_once
      en.cppreference.com/w/cpp/preprocessor/impl
      #ifndef, #define, #endif works 100% of the time all of the time.

  • @nazareno.marcelli
    @nazareno.marcelli ปีที่แล้ว

    Thank you!

  • @ziyad7780
    @ziyad7780 ปีที่แล้ว

    Thank you so much!!

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

    thank you!

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

    You must be good with the ladies the way you clearly explain things🧑‍💻

    • @ProfessorHankStalica
      @ProfessorHankStalica  29 วันที่ผ่านมา +1

      Oh yeah. You should hear me explain virtual functions in my Isaac Hayes voice. Gets 'em every time.

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

    great