so I do realize this is my 3rd post regarding pset5, but I really want to understand it. These are the three questions that I could not answer:
- My code for load() function uses fscanf to go through the dictionary. I created the variable char word to save the word into when it gets fscanfed. How do I make it so that the memory for word is allocated dynamically thus I can save more memory?
- Why do you think we pass before and after by reference (instead of by value) to calculate, even though we’re not changing their contents? I think it is so that copies of the variables do not get created on stack, thus saving memory. I think that is wrong for sure, could someone answer it for me please?
- Why does load() and check() use const char*? Is it so that I cannot modify the data I am being passed in the function, because that would modify the data in the dictionary as well?
Thank you guys.