From fd3e1f9b498f7f381d505f875dceaa8b9878f756 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 25 Aug 2024 23:17:19 +0300 Subject: Update content for html --- gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html') 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 7c501d60..844b52d3 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 @@ -98,7 +98,7 @@ http://www.gnu.org/software/src-highlite -->
Not complicated at all, but nice to know and helps to make the code easier to read!

-

That's not OOP, though


+

That's not OOP, though



However, that's not really how it works in object-oriented languages such as Java and C++. The method call in this example is not a method call as "mult" and "div" in this example are not "message receivers". I mean that the functions can not access the state of the "mult" and "div" struct objects. In C, you would need to do something like this instead if you wanted to access the state of "mult" from within the calculate function, you would have to pass it as an argument:

-- cgit v1.2.3