Line 2: You create a string pointer that is uninitialised and to to be filled in in line 3
Line 3: You call bban_gen, but pass the parameter by value. So bban won't be filled in. You need to change the signature of bban_gen to:
void bban_gen(char** bban)
As bban points to memory allocated from the heap, it should be freed. Your code becomes:
1 2 3 4 5 6 7 8 9 10
int main(int argc, char** argv) {
char*bban = NULL; // You should initialise this pointer to null
bban_gen(&bban); // You need to fill in bban, so you must pass its address
printf("%d\n",country_code(bban,"CZ"));
control_code(bban,1235);
free(bban); // Must free dynamic memory
return (EXIT_SUCCESS);
}
Next, bban_gen. You snprintf to format your output, never use sprintf, or use strcat to concatenate strings.