Q. What does the # character do in a C++ program?
A. The # symbol signals that the line is a preprocessor directive, a command that is handled before the program is compiled. The #include directive includes the full text of a file at that position in the program. The compiler never sees the directive. Instead, it acts as if the contents of the file were typed in with the rest of the source code.
Q. What is the difference between // comments and /* style comments?
A. The comments that start with // are single-line comments that end with the end of the line on which they appear. The /* comments are multi-line comments that don’t end until a */ is encountered. The end of a function won’t even cause a multi-line comment to be ended. You must put in the closing */ mark or the compiler will fail with an error.
Q. What’s the difference between function arguments and function parameters?
A. The terms are two sides of the same process when a function is called. Arguments are the information sent to the function. Parameters are the same information received by the function. You call a function with arguments. Within a function, those arguments are received as parameters.
Q. What is a kludge?
A. A kludge is an ugly solution to a problem that’s intended to be replaced later with something better. The term was popularized by Navy technicians, computer programmers, and aerospace engineers and spread to other technical professions.
In a computer program a kludge is source code that works but would have been designed better if there had been more time. Kludges have a tendency to stick around a lot longer than expected.
The astronauts on the Apollo 13 mission created one of the greatest kludges of all time: a system cobbled together from duct tape and socks that filtered carbon dioxide from the air on the spacecraft and helped them make it back to Earth.
The first known usage of the term was in a 1962 article in Datamation magazine by Jackson W. Granholm, who gave it an elegant definition that has stood the test of time: “An ill-assorted collection of poorly matching parts, forming a distressing whole.”