Ive been in a C++ class for about 2 months now, and im actually working on a mid-term project that is due in 4 days. My code just looks horrible. Does anyone have any pointers they'd like to sling my way on how to properly align brackets. Are there any shortcuts I can take that would limit my entire code to 100 lines ? Take into account that I havent included the code because I am still working on it. Are there any shortcuts to repeating for loops ? I find it difficult to place for loops within for loops ( confuses the crap out of me because my code work is just awful)....Once again, I appreciate any suggestions....
It is hard to advise you anything without looking at "ugly" code. If you would post about, say, 20 lines of code you have problem with, we would voice our thoughts.
First of all: planning and using standard library. This tends to reduce code size dramatically if it was not used before.
Second is to adhere to some consistent style of formatting your code.
I find it difficult to place for loops within for loops ( confuses the crap out of me
If nested loops bother you, consider moving the inner loop to a function. The outer loops simply makes a function call for each iteration. The function then has a single loop to iterate over whatever it is iterating over. Pretty simple to grasp. Tends to make you code cleaner too.