create utils header
This commit is contained in:
parent
e8e9c3f496
commit
c0d67edd47
@ -3,19 +3,6 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define INITIALIZE_ARRAY(a, n, x) do {\
|
||||
for (int i = 0; i < n; i++) { \
|
||||
a[i] = x; \
|
||||
} \
|
||||
} while (0)
|
||||
#define INITIALIZE_MATRIX(a, n, m, x) do {\
|
||||
for (int i = 0; i < n; i++) { \
|
||||
for (int h = 0; h < m; h++) { \
|
||||
a[i][h] = x; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
//#define AS_SYMBOL(c) (c-'a')
|
||||
#define AS_SYMBOL(c) c
|
||||
#define ALPHABET_SIZE 128
|
||||
|
18
source/util.h
Normal file
18
source/util.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
|
||||
#define INITIALIZE_ARRAY(a, n, x) do {\
|
||||
for (int i = 0; i < n; i++) { \
|
||||
a[i] = x; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define INITIALIZE_MATRIX(a, n, m, x) do {\
|
||||
for (int i = 0; i < n; i++) { \
|
||||
for (int h = 0; h < m; h++) { \
|
||||
a[i][h] = x; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user