I didn't pull the trigger and give my 2 week notice today. I pussied out. Depending if I do well on the C++ test tomorrow, I might try and tough it out.
Anyways, the professor gave us 26 optional practice problems, with one of them will being on the test tomorrow. I did half of them so far and I'm feeling good. So there's a 50% of me getting the problem for the exam, which would be sweetttt.
While doing one of the practice problems, I got the weirdest bug which I can't even reproduce anymore or really explain. It's going to sound crazy.
So I three files:
main.cpp
functions.h
functions.cpp
In my functions header and cpp, I have 13 of those problems, each of them having their own method. Each problem had its own method and I would change the main to run only that method.
When running method#13, I would see output to the console that I know is from method#13, however it gets mixed in with some strings that are from method#5. Method#13 does not ever call method#5 at all.
So I commented out method#5 to see what would happen and then I get a mix of method#13 and random messages about minicgwin.
Turns out it was from this code, since when I commented it out, the problem disappeared.
Code:
bool found = false;
for (size_t n = 0; n < length; n++) {
if (line1[n] == line2[n]) {
//int i = n;
found = true;
out << n << " ";
}
When I used i instead of n in my output, it would work. Then when I changed it back, the problem disappeared.
My only guess/theory as a newbie programmer is that whatever address n occupied, had some information from method#5.
My little surprise for today.