C++ Tutorial for Beginners Ep#10 - #define Macros and Macro Functions - SavvyNik

preview_player
Показать описание
C++ Tutorial for Beginners Ep#10 where we learn about the defining Macros/Macro Functions with the #define preprocessor directive in C++. Marcos can help user define various constants / functions that will be filled in by the preprocessor. They can help condense code into one-liners and allow the program to reuse already know function or values. C++ macros can be used with existing preprocessor directives.This C++ Tutorial is for Beginners is intended for learning the concepts of C++. Use Visual Studio Code or any text editor to follow along. Make sure to subscribe so you can follow the series.

When using preprocessor directives and C++ Macros you can define which portion of the code should be compiled. This is good for build/debug compilations. Where you might not want to include debug statements in the final build. A Macro with #ifdef / #ifndef could help you achieve this without having to write two separate files. Let's explore Macros and some of their uses together in this #define Macros and Macro Functions episode of C++ Tutorial for Beginners.

My Linux Cheat Sheet and 25 Page Checklist here:

Share this free tool and support Small YouTubers
(I made this tool to help creators)

Useful Commands/Links:

Online Compilers:

Great List of Online C++ compilers:

Windows Compiler Tools - GCC (GNU Compiler Collection) MinGW64
Linux Compiler Tools - Build-Essentials (GCC)

Name of extensions installed:
1. Code Runner
2. C/C++ Intellisense

#Linux #Programming #ComputerScience
Рекомендации по теме
Комментарии
Автор

can I define macro inside the main function?

Prabhu-vjvh
Автор

Hi there, I have just found your channel, Hope you grow :)

ramitisking
Автор

Nice tutorial) I have a question. If i want to debug source of dynamic library .so. What should i do?

hdhtdoc
Автор

why using macros are more helpful than using functions? By the way,
Great work!

learniumlearnwithfun
Автор

SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

how can fix it

MusaRashid
Автор

How replace text by other text ? I want to replace cin<< "day" with cin<<"Monday" using #define day Monday. So everytime "day" exists the compiler will use "Monday"

mbaceo
visit shbcf.ru