I'm a new student in programing and I have this project of writing a concordance program and I don't really know how to do it.
The program is to read a file containing:
2:1 #Ah, distinctly I
2:1 Ah, #distinctly I remember,
2:1 Ah, distinctly #I remember, it
2:1 distinctly I #remember, it was
2:1 I remember, #it was in
2:1 remember, it #was in the
2:1 it was #in the bleak
2:1 was in #the bleak December,
2:1 in the #bleak December,
2:1 the bleak #December,
2:2 #And each separate
2:2 And #each separate dying
2:2 And each #separate dying ember
2:2 each separate #dying ember wrought
2:2 separate dying #ember wrought its
2:2 dying ember #wrought its ghost
2:2 ember wrought #its ghost upon
2:2 wrought its #ghost upon the
2:2 its ghost #upon the floor.
2:2 ghost upon #the floor.
2:2 upon the #floor.
2:3 #Eagerly I wished
2:3 Eagerly #I wished the
2:3 Eagerly I #wished the morrow;
2:3 I wished #the morrow; vainly
2:3 wished the #morrow; vainly I
2:3 the morrow; #vainly I had
2:3 morrow; vainly #I had sought
2:3 vainly I #had sought to
2:3 I had #sought to borrow
2:3 had sought #to borrow
2:3 sought to #borrow
2:4 #From my books
2:4 From #my books surcease
2:4 From my #books surcease of
2:4 my books #surcease of sorrow,
2:4 books surcease #of sorrow, sorrow
2:4 surcease of #sorrow, sorrow for
2:4 of sorrow, #sorrow for the
2:4 sorrow, sorrow #for the lost
2:4 sorrow for #the lost Lenore.
2:4 for the #lost Lenore.
2:4 the lost #Lenore.
2:5 #For the rare
2:5 For #the rare and
2:5 For the #rare and radiant
2:5 the rare #and radiant maiden
2:5 rare and #radiant maiden whom
2:5 and radiant #maiden whom the
2:5 radiant maiden #whom the angels
2:5 maiden whom #the angels name
2:5 whom the #angels name Lenore,
2:5 the angels #name Lenore,
2:5 angels name #Lenore,
2:6 #Nameless here forevermore.
2:6 Nameless #here forevermore.
2:6 Nameless here #forevermore.
100000:100000 #nine times six
100000:100000 nine #times six is
100000:100000 nine times #six is forty-two
100000:100000 times six #is forty-two
100000:100000 six is #forty-two
and output onto the screen:
Work 2
1:Ah, distinctly I remember, it was in the bleak December,
2:And each separate dying ember wrought its ghost upon the floor.
3:Eagerly I wished the morrow; vainly I had sought to borrow
4:From my books surcease of sorrow, sorrow for the lost Lenore.
5:For the rare and radiant maiden whom the angels name Lenore,
6:Nameless here forevermore.
As far as parsing the lines goes, this is where it gets fun. I think it has to do with analysing Poe's writting style I might be wrong though I never got to do anything like this. That verse is 10 words, 11 words, 11 words, 11 words, 11 words, 3 words. This feels to static of a way to code it but I don't know of a way to distiguish sylabols in C++.
EDIT: Also, don't use dev-C++, don't even use wxDev-C++ if you haven't settled in with it yet. BloodShed is not being developed anymore and has fallen behind and wxDev-C++ has bug issues of it's own. I'm in the process of converting to Code::Blocks myself. http://www.codeblocks.org/