Thanks for your detailed answer.
There won't be more words in the future. It's just a task from school. But thank you for this important hint, I will remember of it, if I have a similar problem.
Oh yes, I could be quite helpful with hints, but oh no, I won't rob you of that. A lot of programming is problem solving, and you have to practice it to be really good at it. Like most skills.
I understand this, but I don't understand how I can get words form a textfile into a structure. I tried to find some tutorials or helpful sites the last days, but now I am really desperated.
I thought of an algorithm formed in words, maybe you (or so.) can help me to get it in C.
- read in line- go sign for sign through the line
- if there is a special sign: go to the next sign
- else: look for the next special sign and if 25 signs are getted compare this word with the other words in the structure
- is it already in this structure, so quantity++;
- else: add the new word
- go to the next line
For this algorithm I would use the following loops, but I have no idea how I can transcript it!
Code:
while(//- read in line)
{while(//- go sign for sign through the line)
{
if(//- if there is a special sign: go to the next sign)//...
else(//- else: look for the next special sign and if 25 signs are getted compare this word with the other words in the structure)//...
if(//- is it already in this structure, so quantity++;)...
else(//- else: add the new word)...
}
//- go to the next line
}
sorry, it doesn't identify the right code-type