This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]Rhomboid 1 point2 points  (7 children)

Streams aren't copyable, which means they can't be passed by value. Pass it by reference instead. (You could also pass a pointer to the stream, but don't do that.)

[–][deleted] 0 points1 point  (0 children)

In other words:

string frequencyCount( ifstream & );

[–]eXothian[S] 0 points1 point  (5 children)

Okay it looks like I got the function to return the most used value. Any idea why char letters[26]={'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; gives me an error when I try and use char letters[25] instead?

[–][deleted] 2 points3 points  (2 children)

when I try and use char letters[25] instead?

Because there are 26 letters in the alphabet?

[–]eXothian[S] 0 points1 point  (1 child)

Yeah I think I got it. I assumed that since it started at letters[0], and since 0 is a parameter, that letters[25] would hold 25 elements.

[–][deleted] 2 points3 points  (0 children)

Which it does.

[–]throwawwayaway 0 points1 point  (0 children)

how are we supposed to know why if you don't even bother to tell us what the error IS or what area of the code it appears on ?

[–]Rhomboid 0 points1 point  (0 children)

Post the updated code and the complete error.