From 6a590ecb54bbe29824f759a988e8f37f00f02458 Mon Sep 17 00:00:00 2001 From: TrebledJ <39648915+TrebledJ@users.noreply.github.com> Date: Fri, 17 Nov 2023 10:46:29 +0800 Subject: [PATCH] content: update --- .../2023-11-16-hkcert-2023-decompetition-vitamin-cpp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/ctf/hkcert23/2023-11-16-hkcert-2023-decompetition-vitamin-cpp.md b/content/posts/ctf/hkcert23/2023-11-16-hkcert-2023-decompetition-vitamin-cpp.md index 4bf421a2e..88748f6ae 100644 --- a/content/posts/ctf/hkcert23/2023-11-16-hkcert-2023-decompetition-vitamin-cpp.md +++ b/content/posts/ctf/hkcert23/2023-11-16-hkcert-2023-decompetition-vitamin-cpp.md @@ -164,7 +164,7 @@ int main() {} {% details "On Struct vs. Class" %} Structs are public by default. Classes are private by default. -Public/private are concepts which fall under {% abbr "OOP", "object-oriented programming" %} [enapsulation](https://www.sumologic.com/glossary/encapsulation). With encapsulation, we bundle data and only expose certain API methods for public users, whilst hiding implementation. With a cyber analogy, this is not unlike exposing certain ports (HTTP/HTTPS) on a machine, and protecting other ports with a firewall. +Public/private are concepts which fall under {% abbr "OOP", "object-oriented programming" %} ***encapsulation***. With encapsulation, we bundle data and only expose certain API methods for public users, whilst hiding implementation. With a cyber analogy, this is not unlike exposing certain ports (HTTP/HTTPS) on a machine, and protecting other ports with a firewall. I chose to use `struct` here because I'm lazy and want to make members public.^[In proper engineering, we would hide implementation behind `private`, so `next_node` should be a private variable.] Some of them are accessed directly in `main` anyway.