[Solved] Deciding how much memory to dynamically allocate based on user input
Here is a description of malloc(). It takes a parameter size, in bytes. So if the user entered 5 words, then you need to first allocate an array big enough to store 5 pointers. Eg. char ** words = NULL; words = malloc(sizeof(char *) * <NUMBER OF CHARACTERS THE USER ENTERED>); If we assume ASCII … Read more