From 275ae06e22840ed1b915ddd313ce32c714de56a9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 3 May 2021 09:03:05 +0100 Subject: a couple of corrections --- content/gemtext/gemfeed/2016-11-20-methods-in-c.gmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'content/gemtext/gemfeed') diff --git a/content/gemtext/gemfeed/2016-11-20-methods-in-c.gmi b/content/gemtext/gemfeed/2016-11-20-methods-in-c.gmi index 45dd3afe..931446af 100644 --- a/content/gemtext/gemfeed/2016-11-20-methods-in-c.gmi +++ b/content/gemtext/gemfeed/2016-11-20-methods-in-c.gmi @@ -71,7 +71,7 @@ Not complicated at all, but nice to know and helps to make the code easier to re ## The flaw -That's actually not really how it works in object oriented languages such as Java and C++. The method call in this example is not really a method call as "mult" and "div" in this example are no "method receivers". What I mean by that is 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: +That's actually not really how it works in object oriented languages such as Java and C++. The method call in this example is not really a method call as "mult" and "div" in this example are no "message receivers". What I mean by that is 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: ``` mult.calculate(mult,a,b)); -- cgit v1.2.3