In C it's not possible.
11/18/2019 3:34:55 AM
Thanks for the Answer to all.
This is helpful for me.
Avinesh c++ structure support many features of class... Except they have default member public... And no support for class templates
Thanks to all for Answers
This is very helpful for me .
It is possible in C, the catch is you have to use function pointers
Yes we can ,for eg. Follow the link above
Yes in C++
Yes in C++ it is possible.
But in C, a member cannot be a function. But a function pointer can be a member of a structure in C
Saurabh B I'm sorry I didn't knew that since I don't use it. But thanks for letting me know.
In C language structures cannot contain functions, C++ have classes and not structures and yes we can have member function in classes.
Shubham u should check stack-overflow.. Link is mentioned above... Just don't give wrong answer
Check code for those having doubt....
Yes saurabh, i didn't see word 'c++' i assume to be question is asked for c language.
Hey guys i accept my fault.👍
The answer of What you are asking is : Class. And this is in C++(Object Oriented Programming).
That's why the concept of class came forth.
It just contain member variables.
Learn Playing. Play Learning
Send us a message