Function Pointers In C

  Рет қаралды 39,860

CppNuts

CppNuts

Күн бұрын

Пікірлер
@aman7492
@aman7492 6 жыл бұрын
One of the best usage of function pointers is in setting up the environment .For e.g. when you boot kernel you know that a certain memory location a certain function is present is present . You can call that function directlt knowing what parameters you have to pass.
@ozancanacar8237
@ozancanacar8237 9 ай бұрын
Amazing content! Just wanted to say that you can also use std::function as a generic function pointer now. Additionally, If you are required to use this on an object's member function you can wrap it with std::mem_fn.
@warrior5741
@warrior5741 4 жыл бұрын
thank you so much for function pointer. i browsed so many sites but i found this channel is very helpful and clear my doubts.
@CppNuts
@CppNuts 4 жыл бұрын
Thanks man..
@YadavJi-im6mw
@YadavJi-im6mw 7 жыл бұрын
This is the best video for function pointer which covers almost everything about the topic function point thanks for uploading such videos.
@CppNuts
@CppNuts 7 жыл бұрын
+Yadav Ji waao thanks for such a nice comment, i try my best.
@MemoriesforLives
@MemoriesforLives 7 жыл бұрын
I have just became fan of your series...keeping sharing your knowledge with us
@CppNuts
@CppNuts 7 жыл бұрын
+monika sharma, Thanks a lot for such a nice comment.
@snehashishpaul2740
@snehashishpaul2740 6 жыл бұрын
It would have taken a lot time for me to understand these concepts. But you have explained it so nicely. Many Many thanks to you Rupesh.
@CppNuts
@CppNuts 6 жыл бұрын
You are most welcome!!
@karthickrajendran7057
@karthickrajendran7057 3 жыл бұрын
Real Master of Programming
@DANMATHEWGAMALE
@DANMATHEWGAMALE Жыл бұрын
i think the last parameter for qsort() function is a comparator function, which usually has return a type of bool.
@bluehornet6752
@bluehornet6752 7 жыл бұрын
Nice video. The use of function pointers, although relatively simple to start, can quickly get pretty complicated even to the point of obfuscation. Your examples are pretty clear and straightforward. Nice job!
@CppNuts
@CppNuts 7 жыл бұрын
+Tom B Thanks man.
@sasikumarreddyanipireddy
@sasikumarreddyanipireddy 4 жыл бұрын
This is the best explanation about the function pointer sir..it's so helpful for my practice..am so thankful to you for sharing ur knowledg. Plz update more vedios in C-language
@ohmnamo7056
@ohmnamo7056 5 жыл бұрын
thanks a lot man....you make us understand the exact concepts without any stories....thanks again
@CppNuts
@CppNuts 5 жыл бұрын
Welcome dude..
@spicytuna08
@spicytuna08 6 жыл бұрын
got your point. i knew qsort use this. but this is not a dynamic binding. i haven't come across a situation where dynamic binding of function pointers is needed.
@CppNuts
@CppNuts 6 жыл бұрын
This is actually a dynamic binding, when you pass some pointer to some function in this case we are passing function pointer then you can pass any other function pointer at run time, depending on the situations. Example: if(some condition true) qsort(begin, end, fun1); else qsort(begin, end, fun2);
@ridcully
@ridcully 2 жыл бұрын
Good conversational explanation style
@CppNuts
@CppNuts 2 жыл бұрын
Thanks
@PerchEagle
@PerchEagle 5 жыл бұрын
all are excellent questions and the answers are also clear and simple.
@CppNuts
@CppNuts 5 жыл бұрын
Thanks for your comment dude!!
@danf4321
@danf4321 2 жыл бұрын
Thank you! This video was very informative
@partha123dbr
@partha123dbr 5 жыл бұрын
8:57 Please explain how to read the variable fun
@CppNuts
@CppNuts 5 жыл бұрын
Google it, how to read function pointer, because there is very good article. And i can't explain here. OR you can start here: stackoverflow.com/questions/2754586/reading-function-pointer-syntax
@りょりょりょ-b6s
@りょりょりょ-b6s 4 жыл бұрын
fun is a function(int,int) returning pointer to function(int,int) returning int
@bsgamer5069
@bsgamer5069 4 жыл бұрын
Damn. Indian KZbinr’s tutorial is the best
@CppNuts
@CppNuts 4 жыл бұрын
Thanks man..
@nickeax
@nickeax 4 жыл бұрын
Thanks, it was very helpful.
@CppNuts
@CppNuts 4 жыл бұрын
Glad it helped!
@mytech6779
@mytech6779 2 жыл бұрын
Does the compiler no create pointers to all functions as normal operation? I understand this is the basic operation of a function call, the function is stored in global/static-data part of the binary and are then called to the working memory by pointer to that address. Making the function name into a pointer name seams very redundant. Because of this I do not understand why a function pointer would be used.
@sivaramakrishnachitithoti1428
@sivaramakrishnachitithoti1428 4 жыл бұрын
Thank you roopesh!!
@CppNuts
@CppNuts 4 жыл бұрын
Welcome dude..
@abhimankonda7151
@abhimankonda7151 4 жыл бұрын
could you please explain how compare function works with Array in qsort?
@glennmarkabalos6657
@glennmarkabalos6657 7 жыл бұрын
i have a question.. why does the compare function accept 2 const void *p.. what is this? and what were passed?
@CppNuts
@CppNuts 7 жыл бұрын
+glenn mark abalos It is because void pointer is generic pointer, so for now we were passing integer but there could be situation where you will sort array of objects and in that case we will have to compare two objects on the basis of some parameter you will say that one object is small than the other one. So as you can see that we don't know what we will sort so that's reason we are sending everything in void pointer, because that is generic pointer and can accept anything. And we are using const because we don't want to modify the data in compare function. And if you're confused with how parameters are passed to compare function then it is the job of qsort function that's why we are passing our own function to qsort as parameter.
@glennmarkabalos6657
@glennmarkabalos6657 7 жыл бұрын
i see.. it's my first time seeing that concept.. thanks.. nice answer..
@CppNuts
@CppNuts 7 жыл бұрын
+glenn mark abalos welcome dude.
@glennmarkabalos6657
@glennmarkabalos6657 7 жыл бұрын
another thing.. can you make a tutorial on how a function can return a two-dimensional array..
@CppNuts
@CppNuts 7 жыл бұрын
glenn mark abalos, sure..
@ramgupta4612
@ramgupta4612 5 жыл бұрын
Thanks a lot sir...
@CppNuts
@CppNuts 5 жыл бұрын
Thanks man!!
@mithunkumar-ke2om
@mithunkumar-ke2om 6 жыл бұрын
Really this video is very helpful ,thanks for uploading such type of nice video I have one request please upload one video on pointer to member function in c++ same as !
@glennmarkabalos6657
@glennmarkabalos6657 6 жыл бұрын
the qsort's last argument is a function.. how can a function have a function as an argument? can you make a tutorial about that?
@CppNuts
@CppNuts 6 жыл бұрын
Hi i have covered that topic in same video here: 6:33
@sasikumarreddyanipireddy
@sasikumarreddyanipireddy 4 жыл бұрын
Hello sir ...I want c program tutorials sir ..can u help me
@CppNuts
@CppNuts 4 жыл бұрын
What video.
@sasikumarreddyanipireddy
@sasikumarreddyanipireddy 4 жыл бұрын
@@CppNuts all pointer concepts based on real time
@rtzstvn
@rtzstvn 6 жыл бұрын
great vid! Use this knowledge and applying at work.
@ashishgupta7849
@ashishgupta7849 4 жыл бұрын
just like callback functions in JavaScript
@CppNuts
@CppNuts 4 жыл бұрын
Correct
@__hannibaalbarca__
@__hannibaalbarca__ 2 жыл бұрын
func(2)[0](3,6) will be exist
@Palletooriabbai
@Palletooriabbai 3 жыл бұрын
are you codebasics . your voice 98% matches with his voice
@CppNuts
@CppNuts 3 жыл бұрын
No i am not CodeBasics. 😊
@selvapriya4115
@selvapriya4115 5 жыл бұрын
null pointer ??????????
@CppNuts
@CppNuts 5 жыл бұрын
??
@selvapriya4115
@selvapriya4115 5 жыл бұрын
@@CppNuts : please give a class about null pointer
@surya1harsha
@surya1harsha 5 жыл бұрын
Nice Videos brother😊 one suggestion , please change your IDE background to white colour & font to black colour.
@agitated_johnson
@agitated_johnson 4 жыл бұрын
okay?
@CppNuts
@CppNuts 4 жыл бұрын
Yaa 😀 habit..
Why Returning Reference Is Bad Some Time In C++?
2:59
CppNuts
Рет қаралды 10 М.
When To Use Reference Over Pointer and Vice Versa In C++
8:40
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
void and void Pointer In C/C++
11:45
CppNuts
Рет қаралды 34 М.
Function Pointers in C / C++
11:57
mycodeschool
Рет қаралды 439 М.
Function pointers and callbacks
15:19
mycodeschool
Рет қаралды 337 М.
Difference Between Reference And Pointers In C++
10:02
CppNuts
Рет қаралды 64 М.
How To Write Your Own atoi Function In C & C++?
8:23
CppNuts
Рет қаралды 52 М.
How To Return 2D Array From Function In C & C++
9:17
CppNuts
Рет қаралды 53 М.
Static Data Member And Static Member Function In C++
17:19
CppNuts
Рет қаралды 52 М.
How To Return An Array From Function In C And C++?
8:28
CppNuts
Рет қаралды 67 М.
placement new In C++
5:08
CppNuts
Рет қаралды 25 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН