From c2a7a5f812ec1fde534adab4c954316643135335 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 23 Jan 2022 16:13:23 +0000 Subject: Publishing new version --- gemfeed/2016-11-20-methods-in-c.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gemfeed/2016-11-20-methods-in-c.html') diff --git a/gemfeed/2016-11-20-methods-in-c.html b/gemfeed/2016-11-20-methods-in-c.html index bf739205..fb71e73e 100644 --- a/gemfeed/2016-11-20-methods-in-c.html +++ b/gemfeed/2016-11-20-methods-in-c.html @@ -8,7 +8,7 @@

Methods in C

-

Published by Paul Buetow 2016-11-20

+

Published by Paul at 2016-11-20

You can do some sort of object-oriented programming in the C Programming Language. However, that is very limited. But also very easy and straightforward to use.

Example

Let's have a look at the following sample program. All you have to do is to add a function pointer such as "calculate" to the definition of struct "something_s". Later, during the struct initialization, assign a function address to that function pointer:

@@ -76,7 +76,7 @@ mult.calculate(mult,a,b)); -- cgit v1.2.3