I need to make an adfgx machine (Code language from WWII) for a project in school. But I am running into some problems.
There is a struct along with some functions defined in adfgx.h which looks like this:
typedef struct {
char* alphabet;
char* symbols;
char* dictionary;
char* transposition;
} adfgx;
In adfgx.c we include the header and I have to write a function that allocates memory for this struct with a predefined signature:
/* Creates a new ADFGX machine */
adfgx* create_adfgx(const char* alphabet, const char* symbols, const char* dictionary, const char* transposition);
So what I am supposed to do here is allocate memory for the struct in that function. I don't get how I am supposed to do this, because I don't now the size of alphabet, symbols, dictionary and transposition, so how can I now hom much memory I need to allocate?