hi,
i know structures are basically used for holding data members whereas classes can hold both functions and data members.
but contrary to the definition of structures can they also hold functions??
i read that they can but there wasn't any explanation about it.
hopefully,some of few can come up with the explanation.

aCTUALLY in C language structures cannot hold functions.

But when u come to c++, there is very little difference between a structure and a class.

U can have functions in Structures in C++ and u can implement many OOPS concepts in structures, the same way as in a class, except few concepts ofcourse.

So the Bottom line is:
In C Structures cannot have functions
In C++ Structures can contain Functions.

Hope this helps

In C structures can hold pointers which can point to functions...So in a way, C structures can hold(point to) functions..

Edited 6 Years Ago by gerard4143: n/a

In C structures can hold pointers which can point to functions...So in a way, C structures can hold(point to) functions..

Yes! I forgot that.

This question has already been answered. Start a new discussion instead.