Will adding comments, having whitespace, or using longer variable names make my code run slower?

No. The program will not run slower. Before the computer runs a code file, the compiler first works with the code. Its job is to take the code and translate it into a set of instructions that a computer can read and follow. A compiler will skip through any whitespace and comments in the code file and create an exe.file. Since, comments and whitespace are omitted in a .exe file, it does not affect the performance of the actual program. Technically, it will take a longer time for the compiler to translate a code file with whitespace and comments, but compilation time is not as important. Therefore, it is best for a code file to be well documented with whitespace and comments.

My cursor is being weird and appears below the characters.

image

Press kbd:[Insert] on your keyboard.

How do I change a floating number into an integer?

image

(int) will take the data value of a variable and convert it into an integer in order to be evaluated. It will not change the type of the variable nor will it overwrite what is stored in the variable. When converting from a floating number to an integer, the computer will ignore all decimals in the floating number. (Ex: 4.9 will change to 4)

In general, putting (<Datatype>) in front of a variable will change the type of a data value. This can be used when some functions only accept certain variable types as inputs.

Why does Code::Blocks not ask me to save my files?

Whenever you build your code, your code file will be saved and an .exe file will be created. Therefore, as long as you continuously build and run your files, you would be saving them in the process. That being said, if you want to try something risky in your code file (such as replacing a lot of lines), make a copy of your code file so that you will always have a backup.

How do I add graphics in C++?

Graphics for C++ is beyond the scope of the beginner course. Graphics in C++ is complicated. If you are very motivated, I would suggest learning SDL, Here is an online tutorial on SDL!

Why is it int main() and not void main()?