Program does what it's supposed to do except for the first time.

Long story short, I wrote a (likely needlessly complicated) program to represent 21 students pulling teams from a hat. Teams A, B, and C have 3 students each, and teams D, E, and F have 4 students.I ran it through codepad (which may or may not be the issue), and everything is pretty chill, except that for the first student's team announcement I get some kind of Wingdings character instead of an actual letter.

The paste is here:

http://codepad.org/f5gtcpLJ

Is this something I did, or just one of codepad's idiosyncrasies?
Last edited on
That's usually caused by not initializing variables, which in your case are the members of the class. That's what the constructor is for.

Also, don't call srand() in the loop.
you dont call setTeam() after you call setPull() on line 83.
So as kbw said: since the 'team' character never gets initialized (or "set") it will just be whatever is in memory at the time.
Last edited on
Topic archived. No new replies allowed.