one more example what you can do is if you have something like let's just say this whole main function I want to make a macro out of this I don't have to write it all in one line just being like you know int main and then STD see and whatever that might be annoying what I can actually do is write int main and then what I actually want another line I can just add a backslash which basically escapes the newline character when I hit enter then I can write my opening curly bracket and on the backslash and then I'll write my STD seeing duck get no the backslash and then this and then I can basically replace this whole thing with main just like that and if I run my code you can see that it runs just fine as before and I can just hit enter and everything's great okay so the back slashes are basically just escaping this Enter key presses it's kind of not feeding in that entered that newline character into the pre process so that actually so that it actually keeps treating this as part of the same macro if you didn't have this then this is just kind of normal code right because macro is kind of do have to be on one line okay but backslash can prevent that make sure you don't have a space after your backslash because then you're actually escaping the space and not not the newline character so it has to be backslash and then answer straight away anyway hope that kind of explains macros to the best way to actually see these in action is to see them in action so when we start the game ends in series and we I've already used them in the OpenGL series actually check out the video about OpenGL errors that has some credit examples on how to actually use macros we use one for actually like wrapping every opengl function call in a macro so that we can arrow check it automatically every time we use in opengl function definitely check that out that's a real world example of how you might use macros when we set the game engine series as well plenty of macros will be used don't worry for stuff like memory allocation as well really useful because another example here that I might just give right now is memory with memory allocation in debug builds we might want to know exactly how many bytes are being allocated from which file and which line of code so literally like please tell me is it coming from mando CPP line NUMBER_TOKEN my allocated NUMBER_TOKEN bytes I want to know that kind of stuff right the tracking or for just debugging purposes for whatever you can actually use a macro to do that if you replace the new keyword with like a custom keyword which which will automatically actually track which line which file in line the allocation came from and how big it was and all that kind of stuff so that's another useful kind of use case for macros anyway I hope you guys enjoyed this video if you did in that like button you can also help support the series that I do here on youtube by going to patron icon for Sasha chana huge thank you as always to everyone who helps support all these videos because they wouldn't be here without all those wonderful supporters next time we're going to probably I might just dive into some more advanced map for a kind of examples actually but there are quite a lot of things that I still need to cover for the C++ series if you want to say something specific definitely leave a comment below and I will see you next time goodbye
START_INTERACTION_TOKEN anyway I hope you guys enjoyed this video if you did in that like button you can also help support the series that I do here on youtube by going to patron icon for Sasha chana huge thank you as always to everyone who helps support all these videos because they wouldn't be here without all those wonderful supporters next time we're going to probably I might just dive into some more advanced map for a kind of examples actually but there are quite a lot of things that I still need to cover for the C++ series if you want to say something specific definitely leave a comment below and I will see you next time goodbye END_INTERACTION_TOKEN