summaryrefslogtreecommitdiff
path: root/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html
diff options
context:
space:
mode:
Diffstat (limited to 'gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html')
-rw-r--r--gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html b/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html
index 5e0f2b5a..8bc8e134 100644
--- a/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html
+++ b/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html
@@ -9,6 +9,7 @@
</head>
<body>
<h1>Object oriented programming with ANSI C</h1>
+<p class="quote"><i>Published by Paul at 2016-11-20, updated 2022-01-29</i></p>
<pre>
___ ___ ____ ____
/ _ \ / _ \| _ \ / ___|
@@ -17,7 +18,6 @@
\___/ \___/|_| \____|
</pre><br />
-<p class="quote"><i>Published by Paul at 2016-11-20, updated 2022-01-29</i></p>
<p>You can do a little of object-oriented programming in the C Programming Language. However, that is, in my humble opinion, limited. It's easier to use a different programming language than C for OOP. But still it's an interesting exercise to try using C for this.</p>
<h2>Function pointers</h2>
<p>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:</p>
@@ -84,7 +84,7 @@ mult.calculate(mult,a,b));
<p>Big C software projects, like Linux, also follow some OOP techniques:</p>
<a class="textlink" href="https://lwn.net/Articles/444910/">https://lwn.net/Articles/444910/</a><br />
<p>C is a very old programming language with it's quirks. This might be one of the reasons why Linux will also let Rust code in.</p>
-<p>E-Mail me your comments to paul at buetow dot org!</p>
+<p>E-Mail me your comments to paul at buetow dot org! :-)</p>
<a class="textlink" href="../">Go back to the main site</a><br />
<p class="footer">
Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> |