Im just wondering if the way im writing to a file is bad and if so, if there is a cleaner way i could do it. The section of my code im talking about is inside a switch statement and its as simple as it looks, if the case is "0" then it just writes all of this into the file.
1 2 3 4 5 6 7 8
case 0:
File << "Whatever" << endl;
File << "Whatever" << endl;
File << "Whatever" << endl;
//imagine 181 lines of basically this with a few variables here and there.
break;
imagine 181 lines of basically this with a few variables here and there.
What exactly are you trying to do here? I'm sure there is an easier way than writing out 181 lines of code.
1 2 3 4 5 6 7 8
case 0: {
File << "Whatever" << endl;
File << "Whatever" << endl;
File << "Whatever" << endl;
//imagine 181 lines of basically this with a few variables here and there.
} break;
Most people add brackets when their case has more than one line. It doesn't have to be there, but I think it makes things look neater.
Its a starcraft 2 bank generator hack, its already fully working im just cleaning up the code at this point. And no it dosent really have to be like this but i dont see another way to do it that would make it easier.