Stupid bug

I was tearing my hair out because of this one stupid bug. I thought I was doing something wrong with file IO or initializing the constructor variables. Turns out I had a compilable but erroneous for loop constructor. You can see it clearly after StartingPosY.
defPlayWriter << “Title:” << ‘ ‘ << newPlay.playTitle << ‘\n’; //’\n’ may be unneccessary, since c++ string null terminated
for (int i = 0; i < 11; i++){
defPlayWriter << newPlay.positions[i] << ‘,’;
}
defPlayWriter << ‘\n’ << “StartingPosX: ” << ‘:’;
for (int i = 0; i < 11; i++){
defPlayWriter << newPlay.startingPosX[i] << ‘,’;
}
defPlayWriter << ‘\n’ << “StartingPosY:” << ‘ ‘;
for (int i = 0; i << 11; i++){
defPlayWriter << newPlay.startingPosY[i] << ‘,’;
}
defPlayWriter << ‘\n’ << “Job:” << ‘ ‘;
for (int i = 0; i << 11; i++){
defPlayWriter << newPlay.job[i] << ‘,’;
}
defPlayWriter << ‘\n’ << “ZoneSpotX:” << ‘ ‘;
for (int i = 0; i << 11; i++){
defPlayWriter << newPlay.zoneSpotX[i] << ‘,’;
}
defPlayWriter << ‘\n’ << “ZoneSpotY:” << ‘ ‘;
for (int i = 0; i << 11; i++){
defPlayWriter << newPlay.zoneSpotY[i] << ‘\n’;
}
defPlayWriter << ‘\n’ << “OppMan:” << ‘ ‘;
for (int i = 0; i << 11; i++){
defPlayWriter << newPlay.oppMan[i] << ‘,’;
}
defPlayWriter << ‘\n’ << “rushGap:” << ‘ ‘;
for (int i = 0; i << 11; i++){
defPlayWriter << newPlay.rushGap[i] << ‘,’;
}

 

I think this is why companies are willing to pay so much for static analysis tools.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s