Тёмный

Function Pointers for beginners! How and when to use Function Pointers? 

CodeBeauty
Подписаться 279 тыс.
Просмотров 65 тыс.
50% 1

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
Download Visual Assist here: bit.ly/WT-CB
I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
Download Ultra Edit here: bit.ly/UE-CB
It is a powerful, secure text editor designed specifically for programmers.
If you want to learn how to build modern C++ GUI apps you can download C++Builder here: bit.ly/CppBuilderFree
and use this video as a tutorial: • Build C++ GUI apps FAS...
Function pointer is a special type of pointer that is used in order to store the address of a function.
Function pointer syntax is complex and many beginners find it hard to understand.
In this video, I'll explain how to use function pointers in C++ and what is their purpose.
I'll show you how to create a function pointer, how to invoke a function using a function pointer, and also how to use and create function pointers to functions that receive parameters/arguments.
Function pointers are often used in order to optimize the code and make it reusable, and in this video, I'll explain how to use a function pointer in order to pass a function as a parameter/argument to another function.
☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. Use the link to make a contribution: bit.ly/CodeBeauty_BuyMeACoffee
However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
Contents:
00:00 - Intro to function pointers
01:26 - What are function pointers?
03:40 - How to create a function pointer?
05:25 - How to invoke a function using a function pointer?
06:10 - Pointer to a function with parameters
09:01 - Why and when to use function pointers?
16:12 - How to pass a function as a parameter/argument to another function?
Follow me on other platforms:
Instagram 📸 - / truecodebeauty
Twitter 🐦- / truecodebeauty
******CODE IS IN THE COMMENTS******

Наука

Опубликовано:

 

29 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 246   
@CodeBeauty
@CodeBeauty 3 года назад
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time. #include #include using namespace std; bool ascendingCompare(int a, int b) { return a < b; } bool descendingCompare(int a, int b) { return a > b; } void sortAscending(vector& numbersVector) { for (int startIndex = 0; startIndex < numbersVector.size(); startIndex++) { int bestIndex = startIndex; for (int currentIndex = startIndex + 1; currentIndex < numbersVector.size(); currentIndex++) { // We are doing comparison here if (ascendingCompare(numbersVector[currentIndex], numbersVector[bestIndex])) bestIndex = currentIndex; } swap(numbersVector[startIndex], numbersVector[bestIndex]); } } void sortDescending(vector& numbersVector) { for (int startIndex = 0; startIndex < numbersVector.size(); startIndex++) { int bestIndex = startIndex; for (int currentIndex = startIndex + 1; currentIndex < numbersVector.size(); currentIndex++) { // We are doing comparison here if (descendingCompare(numbersVector[currentIndex], numbersVector[bestIndex])) bestIndex = currentIndex; } swap(numbersVector[startIndex], numbersVector[bestIndex]); } } void customSort(vector& numbersVector, bool(*compareFunctionPtr)(int, int)) { for (int startIndex = 0; startIndex < numbersVector.size(); startIndex++) { int bestIndex = startIndex; for (int currentIndex = startIndex + 1; currentIndex < numbersVector.size(); currentIndex++) { // We are doing comparison here if (compareFunctionPtr(numbersVector[currentIndex], numbersVector[bestIndex])) bestIndex = currentIndex; } swap(numbersVector[startIndex], numbersVector[bestIndex]); } } void printNumbers(vector& numbersVector) { for (int i = 0; i < numbersVector.size(); ++i) cout
@hbm293
@hbm293 3 года назад
Due to the cumbersomeness of the types of these function pointers, they are good candidates for being typedef'ed: typedef bool (*SORT_FUNC)(int, int); void customSort(vector& numbersVector, SORT_FUNC compareFunctionPtr) { .... } SORT_FUNC funcPtr = descendingCompare; // Here in C++11 one could use that "auto" keyword to not have to write the actual type of 'funcPtr'.
@arod3295
@arod3295 2 года назад
when I used "cout
@giuseppecinque2828
@giuseppecinque2828 2 года назад
It is a bubble sort
@kevin_mitchell
@kevin_mitchell 7 месяцев назад
​@@arod3295 This is my behaviour too, but I'm using the Terminal and not VSCode. cout
@NipkowDisk
@NipkowDisk 3 года назад
Saldina, I said it in the chat and I will say it here: your videos are well worth watching in my opinion as you are concise, thorough, and pleasant to listen to. Please keep up the excellent work!!
@CodeBeauty
@CodeBeauty 3 года назад
Thank you so much, I will! 🙏💙💙
@mexxiano
@mexxiano 3 года назад
Saldina! We love you all around the World! Cheers from Argentina!
@lalaff3012
@lalaff3012 3 года назад
Cheers from Brazil!
@CodeBeauty
@CodeBeauty 3 года назад
I love you too! 💙💚 🇦🇷🇧🇷
@luisrobertoflores3278
@luisrobertoflores3278 3 года назад
Cheers from El Salvadorl!
@iam_mausam
@iam_mausam Год назад
Cheers from India 🇮🇳
@unchris
@unchris Год назад
Cheers from Peru
@shahzahir9990
@shahzahir9990 3 года назад
It's nice to see you again Mam🙂
@CodeBeauty
@CodeBeauty 3 года назад
🥰🥰🤗
@pkentertainment2143
@pkentertainment2143 3 года назад
Thankyou somuch..i really need this
@CodeBeauty
@CodeBeauty 3 года назад
You will understand why and when to use function pointers after watching this! 🤗🤗🥰
@pkentertainment2143
@pkentertainment2143 3 года назад
@@CodeBeauty thankyou ❤️🥰
@astudent797
@astudent797 3 года назад
Awesome explanation
@CodeBeauty
@CodeBeauty 3 года назад
🙏💙
@muhammadumair6554
@muhammadumair6554 3 года назад
Great videos, hope you complete 100k subscribers soon❣️
@CodeBeauty
@CodeBeauty 3 года назад
I hope so ☺️ Thank you! 🙏💙
@sanderverhage5148
@sanderverhage5148 2 года назад
Great video, but some aprovements. First a typedef helps a lot with the strange syntax. For example: typedef bool (*Compare_T)(int,int); Compare_T myFuncPtr; Sort( vector& Numbers, Compare_T OnCompare ); Second why don't you pass your compare function directly? Sort( myNumbers, AscendingCompare );
@streambumper250
@streambumper250 2 года назад
I'm self-learning C++ and your videos are really helpful. This is a very clear explanation about function pointers. Thank you so much for your hard work =)
@vishwa2602
@vishwa2602 3 года назад
Thanks a lot ...❤️❤️❤️...
@CodeBeauty
@CodeBeauty 3 года назад
❤️❤️❤️
@phoebewell3653
@phoebewell3653 3 года назад
I really need this, thanks, it's very helpful
@CodeBeauty
@CodeBeauty 3 года назад
🙏💙
@herlim6927
@herlim6927 3 года назад
@@CodeBeauty 🙏 love from india
@CodeBeauty
@CodeBeauty 3 года назад
@@herlim6927 💚🧡🇮🇳
@JC-px9mk
@JC-px9mk 3 года назад
Thank you for all the videos, they already taught and helped me a lot🥰 and you are kind of someone I look up to soo, just thank you and have a nice day
@CodeBeauty
@CodeBeauty 3 года назад
Making these videos is a lot of hard work but comments like this bring me a lot of joy! Thank you so much and I wish you happy learning and hope you'll have a great day! 🥰🥰🤗
@deneristargerian6755
@deneristargerian6755 3 года назад
Love your videos! Your explanations are excellent!
@CodeBeauty
@CodeBeauty 3 года назад
🤗🥰🥰
@lindeanchuang8115
@lindeanchuang8115 2 месяца назад
Hi, I am from Taiwan. Thank you very much! Your tutorial is always very clear! I love the style you teach!
@bene8114
@bene8114 3 года назад
Saldina. Many thanks for ur courses. One thumb up is not enough.
@CodeBeauty
@CodeBeauty 3 года назад
Thank you so much! 🙏💙💙
@MegaAtlus
@MegaAtlus 3 года назад
After these videos, i'm feeling myself like senior C++ Developer:) Thanks!
@CodeBeauty
@CodeBeauty 3 года назад
I'm so happy if my videos can motivate you and make you like programming! 🥰🥰🥰
@joebosah2727
@joebosah2727 2 года назад
You are just starting
@user-ck4yi1hs4x
@user-ck4yi1hs4x 9 месяцев назад
I used to hate using Pointers but I start to love it now This vid pushes my peak interest further
@nishaternotes
@nishaternotes 3 года назад
bool compare(int a, int b){ return a < b;} sort(arr.begin(), arr.end(), compare); I was always wondering how this function works and today I have learned it from you. Thank you for your all videos
@daniloheat
@daniloheat 2 года назад
Callback functions have always been a problem for me as I learn them and immediately forget them. But your explanation is very straightforward and I finally learnt what each part of the syntax is doing. Thank you very much. Keep doing these great videos.
@sergeistalarkin7969
@sergeistalarkin7969 3 года назад
Спасибо ^_^
@CodeBeauty
@CodeBeauty 3 года назад
Пожалуйста 🤗🥰🥰
@MrPassy4u
@MrPassy4u 10 месяцев назад
Been 20 years ago when I wrote my last c/c++ program at school. But this serie makes me want to code some old school tasks
@remimonsel9944
@remimonsel9944 Год назад
Function pointers are awesome. That's programming art. Every time, I think I know everything but luckily with you and your channel, there is always something more.
@amk2298
@amk2298 3 года назад
ur voice is very sweet, thanks saldina for this awesome video🙏
@CodeBeauty
@CodeBeauty 3 года назад
🙏💙
@ravulaakhilsurya8569
@ravulaakhilsurya8569 3 года назад
Hey saldina ,your student here from RU-vid community requesting you to make Code reading vlogs on c++ You can ask us (your subscribers) to send their codes to you so that you can explain better way of writing the same code for the questions 🙋🙋🙋
@tomwellington4255
@tomwellington4255 Год назад
I have found your C++ videos very down to earth and really easy to understand. Thank you!
@Ghisisan_
@Ghisisan_ 3 года назад
Great video! Function pointers make sense and can be usefull but I really never heard of function pointers until now, even though I studied computer science(about 18 years ago)... 😁 Thanks for teaching me new things about programming.👍
@CodeBeauty
@CodeBeauty 3 года назад
Yep, they are very useful. I use them very often when I want to invoke a method of the parent class from the child class 🤗🤗😃
@tarnished_ofTheCGPA
@tarnished_ofTheCGPA Год назад
i can not believe how easy you made it , thanks a lot ❤
@TheJacov
@TheJacov 2 года назад
What did I learn? Two things. 1. The code builds and runs, but it generates about a dozen warnings so I had to track down the problem to get rid of them, I prefer code that doesn't generate warnings. 2. If you want to run both sorts at the same time, you must use two different pointers, that was an easy fix. Problem 1 was harder to track down but I figured it out. It seems that the .size function returns unsigned values, while the loop variables are signed and the < causes complaints. The solution I came up with was to type cast the loop variables in the comparison part of the for loops to (unsigned), this made the warnings go away and made me happy.
@samuelholmes4547
@samuelholmes4547 9 месяцев назад
I'm a C++ beginner and this was well done. This was very easy to follow and I will be tuning in for more videos.
@shashankcool
@shashankcool 2 года назад
Thanks Saldina for explaining the function pointer concept with proper example. Please keep making such videos.
@yash9725
@yash9725 Месяц назад
understood! thanks for the video!
@yassinekhadiri6829
@yassinekhadiri6829 Год назад
Thank You For Your Amazing Explanation :)!
@shrinivasgadade5153
@shrinivasgadade5153 3 года назад
your videos are simple and concise and make us love programming, thank you for such awesome videos.
@anjalililhare7128
@anjalililhare7128 12 дней назад
Amazing example. Thank you
@tuazulyrojoeljean
@tuazulyrojoeljean 11 месяцев назад
Yep, definitely very helpful, thank you very much, Saldina!
@khavovan8201
@khavovan8201 2 года назад
So easy to understand. Thank you so much!!!
@yt_bharat
@yt_bharat 3 года назад
Your accent is really sweet ❤️ and Saldina you rock 😎
@CodeBeauty
@CodeBeauty 3 года назад
🙏💙💙
@nezbrun872
@nezbrun872 16 дней назад
FWIW, function pointers have very practical use in embedded systems e.g., for dynamic interrupt callbacks, and as performant alternatives to lengthy case statements in state machines.
@greciahernandez5422
@greciahernandez5422 8 месяцев назад
Thank youu!! your explanation is really clear throughout
@julyordinary7538
@julyordinary7538 2 года назад
Best part is real life usage examples so really nice video
@acceleratorlevel645
@acceleratorlevel645 Год назад
Hey thanks for the great explanation and where to use it, i kinda knew the syntax of func ptr but wasn't sure where to use them, this helped a lot!
@jhordyperez1594
@jhordyperez1594 3 года назад
excellent video, little by little I'm starting to love this girl, because of how smart she is and the dedication that she puts into each video. Thank you for taking the time to publish this kind of videos. much that helps many of us to better understand ......
@CodeBeauty
@CodeBeauty 3 года назад
Thank you for supporting me! It requires a lot of hard work to prepare, film, and edit the videos, but it also brings me great joy! 💗💗💗
@typhoond4499
@typhoond4499 3 года назад
Exactly what I needed. Thank you very much Saldina!
@CodeBeauty
@CodeBeauty 3 года назад
🥰🥰🤗
@HengOngHuatAh
@HengOngHuatAh 2 года назад
Thank you so so so much!!!
@user-li7wn6qv7e
@user-li7wn6qv7e Год назад
i already know about function pointer but I got so much clarity in this video that I was missed. You are great...in simple Function pointers are used instead of switch case (i.e) to reduce the code
@sirmovielover
@sirmovielover 2 года назад
Thank you. My professor assigned a function pointer assignment, but he didn't have time to really explain it. This really helped :-)
@remimonsel9944
@remimonsel9944 6 месяцев назад
This video is such a good one. I spent 2 hours trying to do the function as a parameter until I think of this video and solved my issue in 4 minutes. You’re awesome Saldina ❤
@CodeBeauty
@CodeBeauty 6 месяцев назад
❤️❤️💪
@thedishmastersa
@thedishmastersa 12 дней назад
I love you and your videos, please keep on teaching us.
@smoothoctopus
@smoothoctopus 3 года назад
the countless embedded code I've read through and copied and pasted that refused to work because of missing functions that pointers were looking for...I never understood the problem until now...Thank you for the detailed video and the channel, I'm slowly working through all your tutorials!....Beyond that..uff that accent
@pedrolobo9835
@pedrolobo9835 3 года назад
Excellent video. I think it's simpler and pratical to call the compare function directly in customSort. Like this: int main(){ vector numbersVector = {4, 2, 1, 3, 6 ,5}; customSort(numbersVector, descendingCompare); printNumbers(numbersVector); system("pause>0"); }
@musolodemiano7982
@musolodemiano7982 2 года назад
Your videos are really nice and enchanting
@Tonboswimmers
@Tonboswimmers 2 года назад
unbelievable again, learnt so much from your this example, initially I feel lost trying to catch up with all the codes nest, now with this more complicated one, I get to see how it all flows. Never miss a lesson to learn from her, very well put together.
@CodeBeauty
@CodeBeauty 2 года назад
Happy to hear that ☺️🤗
@Kinsey_
@Kinsey_ 3 года назад
I love your videos! Please continue to make them. It’s a good supplement to class.
@CodeBeauty
@CodeBeauty 3 года назад
🙏💙
@rolandocruz15
@rolandocruz15 8 месяцев назад
Made perfect sense to me. Thank you for putting this video together. The concept is complex, but you made it very easy to understand. I am now subscribed to your channel!
@rafiullahafridi11
@rafiullahafridi11 3 года назад
One of the best instructor Ms Saldina..... I am ur subscriber from Pakistan
@ucNguyen-hg2xz
@ucNguyen-hg2xz 3 года назад
Very nice
@CodeBeauty
@CodeBeauty 3 года назад
Thanks, but how did you find this video? 🧐😲 It is still unlisted 😁😅
@ucNguyen-hg2xz
@ucNguyen-hg2xz 3 года назад
@@CodeBeauty Really? I've finished it :3
@wcchang3321
@wcchang3321 Год назад
Great video!
@Kenforbes3
@Kenforbes3 Год назад
Thanks!
@alifawzi8197
@alifawzi8197 3 года назад
keep the cool work that you doing miss saldina
@kayd2143
@kayd2143 Год назад
Great video, easy to understand. I understood what the code that I thought looked complex in your video meant and I surprised myself. All thanks to your explanation
@swayam50
@swayam50 3 года назад
You're amazing, thanks for keeping the spirit of C++ alive ❤️❤️❤️
@CodeBeauty
@CodeBeauty 3 года назад
❤❤❤!
@anwar6971
@anwar6971 3 года назад
Very well explained. I understood very well.
@CodeBeauty
@CodeBeauty 3 года назад
🤞🤗🥰
@virgoash7775
@virgoash7775 3 года назад
Thanks 😌.
@burakabdulbakiulu3509
@burakabdulbakiulu3509 2 года назад
Idk you have took any diciton course but you have a very smooth explaination.👍 Thank you very much.
@user-bu8mg7uq3s
@user-bu8mg7uq3s 2 года назад
amazing explanation
@ethangold4900
@ethangold4900 2 года назад
I'm a beginner in C++ and I think I wouldn't get function pointers in my first try if I was on my own.. I first heard about function pointers in this video (the last video in your pointers playlist) and I learned a lot, thank you so much P. S. Your videos are great overall, not just this vid, so I subbed
@ShayHowardBennett
@ShayHowardBennett 3 года назад
Another banger Sald, keep it comin!
@stefanopilone957
@stefanopilone957 3 года назад
Thank You, very clear explanation, so I could recap qsort() function
@CodeBeauty
@CodeBeauty 3 года назад
🤗🥰🥰
@Mohammed-zp5sj
@Mohammed-zp5sj 3 года назад
Good 👍 I love what you do
@Lmn168
@Lmn168 3 года назад
thanks for the 10 hour course and everything
@CodeBeauty
@CodeBeauty 3 года назад
🙏💙
@dominiclogue5924
@dominiclogue5924 3 года назад
Thank you for this great video.
@CodeBeauty
@CodeBeauty 3 года назад
🤗🥰🥰
@painsme2
@painsme2 3 года назад
Very useful. Thanks!
@CodeBeauty
@CodeBeauty 3 года назад
🤗🤗🥰
@mahdavimail
@mahdavimail 3 месяца назад
This one was good training+usecase thanks
@CodeBeauty
@CodeBeauty 3 месяца назад
You're welcome 🥰
@TheJacov
@TheJacov 2 года назад
Oh yea, I have to agree with Denerius Targerian, your videos are very informative and easy to follow.
@peacefuldeityspath
@peacefuldeityspath 3 года назад
Omg thx i really needed this for my memory Editor gui :D
@CodeBeauty
@CodeBeauty 3 года назад
🤗🤗🥰
@nigusdibekulu5215
@nigusdibekulu5215 3 года назад
Love u saldina❤❤, u r the best. from Ethiopia
@astet
@astet 3 года назад
my 2 Year c++ in University was a lie. I love your Videos. Can you please make video about Iterations please!
@denisdobra3627
@denisdobra3627 3 года назад
Omg you are the best programming 'teacher' on youtube
@CodeBeauty
@CodeBeauty 3 года назад
Thank you 🥰🥰 Fun fact, my programming teacher's name at University was Denis 😃😃
@per-erikjansson1774
@per-erikjansson1774 2 года назад
Great with simple explanations, I think the use of std::function may also have been commented. I have used that especially inside classes instead of pointers to member functions.
@jasonchen9713
@jasonchen9713 3 года назад
why do we need to vector& numbersVector, & here? any previous video cover this?
@holyshit922
@holyshit922 2 года назад
I use function pointers when i write list (sorted instert function or sorting function) or a program for numerical integration (fe with rectangles, trapezoids, or Simpson)
@scrpld7111
@scrpld7111 3 года назад
You have a good thing going on keep up the good work. I think it's possible to do, but would be nice to see a code that first ask for mathematical equation and then solves it with user given numbers also. But I think this kinds of programs have been made already like MathCad for example and others, but I think it could be a good challenge to do.
@anhtravu
@anhtravu 3 года назад
Thank for your sharing, that very helpful. Could you please make a season sharing the callback function ? Why callback functions should be static ? Thank you in advance !
@muhammadbeygzadeh5224
@muhammadbeygzadeh5224 9 месяцев назад
amazing
@yousefibrahim8862
@yousefibrahim8862 3 года назад
Hello CodeBeauty, I'm just wondering why don't you instead use std::sort to sort the vectors?
@GuidoMoreira
@GuidoMoreira 3 года назад
Thank you for your explanation. I am learning a bit of C++ and have a question, if that's ok. I have come across passing functions as arguments as I needed to do it. In particular, I have a class and a member function is "attached" via another member function. So I declare the function pointer in the class and pass the desired function from the main program to the class via the attacher function which receives the adequate function in its arguments. Buuut, for some reason I have been able to do it by defining the attacher function and its arguments is not a pointer, like void attacher(double funfun(int v)){member = funfun;} Does this mean that the attacher is passing funfun by value? Like, making a copy of the function?
@boko7654
@boko7654 3 года назад
Hello, I hard a really hard time trying to understand direct and copy initialization. I couldn't tell the difference between: int a = 4; int a(4); When the compiler reaches int a = 4;, does the compiler first declare the variable a then the literal gets copied to a? The most confusing part is that there are braces as well. int a{4}; I couldn't tell if I should use with brackets or braces in this case. I would be highly appreciated if there will be a video dedicated to this soon. Your layman's terms explanations are spot on.
@mba2ceo
@mba2ceo 9 месяцев назад
Standard library header please explain
@entertainment9625
@entertainment9625 2 года назад
i like your glasses saldina hahah im zouhir nice to meet you !!
@Laberyio
@Laberyio 9 месяцев назад
Hello , i have maybe a dumb question but at line 37 is it possible (and good) to directly invoke either ascendingCompare or descendingCompare inside your customSort without storing it into your pointer at line 36 ? Would it be beneficial ?
@muneeburrehman4690
@muneeburrehman4690 2 года назад
Can we decide on run time that which function's address will be stored in our function pointer?
@angel_machariel
@angel_machariel 2 года назад
Is there a special reason why - in Main() - the sort order function is passed to a functionpointer, and then the functionpointer is passed as a parameter to another functionpointer? You might as well pass the sort order method straight into the second sorting algorithm parameter. Why the extra indirection?
@bashiraddean-mufarreh
@bashiraddean-mufarreh Год назад
Can I creat pointer and to using it read only
@SimpleY_
@SimpleY_ 3 года назад
Can you please make a video about short-cuts in Visual Studio? I see that you often use short cuts, for example to multi-line comment. Short cuts can save us a lot of time, but many people don't know how to use them. Thanks in advance!
@CodeBeauty
@CodeBeauty 3 года назад
That is great idea. I'll definitely make that video in the future 😃🤗🤗
@siddharthasarmah9266
@siddharthasarmah9266 3 года назад
Well Saldina, can you make a video on const char* which is used as a string in c/c++. It doen't make much sense to me, so if you can, then please make a video on that. Thanks! Love your videos😊
@samer820
@samer820 2 года назад
How could your "cout
@fireballgfx
@fireballgfx 3 года назад
Ok now I'm able to build a while loop with a function pointer call inside. All fired methods have to take care to change the address of the function ptr to that method who have to be called next. In the case I would like to pass some variables I will use a void* - that sounds great!
@martincatalanoresi7200
@martincatalanoresi7200 Год назад
I love you ❤️
@christiancarter255
@christiancarter255 2 года назад
I'm guessing that without the parentheses, we'd output to the console the address location (from RAM) of the function. 2:55 Oh! I was right! :) That's pretty cool. This was a very good and practical use of function pointers. I was experimenting with them, but hadn't imagined that this could be done with them! :)
@inayatkhan2061
@inayatkhan2061 2 года назад
Can you make videos where you explore famous c++ libraries and the most important options that they offer?
Далее
SMART POINTERS in C++ (for beginners in 20 minutes)
24:32
Наше обычное утро 💕
00:42
Просмотров 1,5 млн
Function Pointers in C++
12:41
Просмотров 384 тыс.
why do header files even exist?
10:53
Просмотров 381 тыс.
Master Pointers in C:  10X Your C Coding!
14:12
Просмотров 291 тыс.
Weak Pointers in C++ (std::weak_ptr)
17:25
Просмотров 43 тыс.
Function Pointers | C Programming Tutorial
18:31
Просмотров 57 тыс.
iPhone 16 - 20+ КРУТЫХ ИЗМЕНЕНИЙ
5:20
Новодельный ноутбук Pocket386
1:16:17
10 МИНУСОВ IPHONE 15
18:03
Просмотров 41 тыс.