summaryrefslogtreecommitdiff
path: root/C/HF/chap7/encrypt.c
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2025-09-25 15:26:57 +0200
committerCarlos Maiolino <[email protected]>2025-09-25 15:26:57 +0200
commit29e2e93f3f32efa47e95f95260431167e228fe7a (patch)
tree4961bbea472b0b98f29a5a82565c92aa3586d7a9 /C/HF/chap7/encrypt.c
parent4d1c070b813f3b3b64bd8bf96723756041840ac0 (diff)
chap7: add small programs made in chap7
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'C/HF/chap7/encrypt.c')
-rw-r--r--C/HF/chap7/encrypt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/C/HF/chap7/encrypt.c b/C/HF/chap7/encrypt.c
index 1b5ce25..6c3eccd 100644
--- a/C/HF/chap7/encrypt.c
+++ b/C/HF/chap7/encrypt.c
@@ -1,6 +1,13 @@
#include "encrypt.h"
-typedef void (*encrypt_fn_t)(char *message);
void encrypt(char *message, encrypt_fn_t encrypt_fn) {
encrypt_fn(message);
}
+
+void encrypt_arr(char *message, encrypt_arr_t fn_arr, int size)
+{
+ int i;
+
+ for (i = 0; i < size; i++)
+ encrypt(message, fn_arr[i]);
+}