summaryrefslogtreecommitdiff
path: root/C/HF/chap7/encrypt.c
diff options
context:
space:
mode:
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]);
+}