Question about string, binary tree and hash table
I'm making a program that takes words from a book and counts word repetitions and their location. The output will be these sorted words, their location and number of repetitions. I'm thinking of using binary tree and symbol table, but I have the impression that the hash table is more efficient for large amounts of data... what do you think? Another question is about strings in c. I want to allocate memory for a pointer called "world" which is a field of my struct. I tried to allocate inside the struct itself. For example: typedef struct No{ char *world: world = (char*) malloc(sizeof(10)); } but it seems that this is not working. What's the correct way to store a string that I don't know the length of? I'm starting in C ;-; help me please and thanks!