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

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

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

  • @eduardogallegos9
    @eduardogallegos9 Год назад +10

    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: ruclips.net/video/YHI5xamiheA/видео.html
      Don't forget that RUclips 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.

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

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

  • @nazareno.marcelli
    @nazareno.marcelli Год назад

    Thank you!

  • @whoziee
    @whoziee 10 месяцев назад

    Great stuff 🙂

  • @dariusz4434
    @dariusz4434 5 месяцев назад

    '#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  5 месяцев назад

      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.

  • @ziyad7780
    @ziyad7780 Год назад

    Thank you so much!!

  • @AozenDreyar
    @AozenDreyar Год назад

    thank you!

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

  • @PoetryInMotion946
    @PoetryInMotion946 4 месяца назад

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

    • @ProfessorHankStalica
      @ProfessorHankStalica  Месяц назад +1

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

  • @callmegary2622
    @callmegary2622 11 месяцев назад

    great