Copy and compile the program /home/comp210/public_html/Labs/lab13/error2.cc. It complains

error2.cc:3: parse error before `('
error2.cc: In function `int main(...)':
error2.cc:13: warning: `float' used for argument 1 of `c2f(int)'
The second two lines of errors mean that in the function main, on line 13 we call the function c2f with a float, but it expects an int. Can you fix the problems?

For the curious: This error is just a warning because C/C++ lets you get away with things like this -- it will automatically convert the float to an int. In some other languages, this is a true error and not just a warning. Try running the result. It works, except that it truncates the input to an integer. (Note also that it uses integer division for c/5, i.e., it truncates that intermediate result, too.)

For the curious: This warning also says that main returns an int, even though we said it returns a void. What's going on? Every program returns an error code, which is an integer, describing whether an error occurred while running the program. We won't use this error code in our programs.

Copy and compile the program /home/comp210/public_html/Labs/lab13/error3.cc. It complains

error3.cc: In function `int main(...)':
error3.cc:10: `cin' undeclared (first use this function)
error3.cc:10: (Each undeclared identifier is reported only once
error3.cc:10: for each function it appears in.)
error3.cc:10: `c' undeclared (first use this function)
error3.cc:11: `cout' undeclared (first use this function)
error3.cc:11: `endl' undeclared (first use this function)
I.e., there are a bunch of things which haven't been properly been declared/defined/introduced. Look at the program -- can you identify what these errors are complaining about and what caused them?

Copy and compile the program /home/comp210/public_html/Labs/lab13/error4.cc. It complains

error4.cc: In function `int main(...)':
error4.cc:12: no match for `operator <<(class _IO_istream_withassign, float)'
I.e., in the function main, on line 12, there is no definition of << appropriate for its use. Can you find the error?

For the curious: This is basically shows that input stream cin and output stream cout are not of the same type. Furthermore, the message shows that cin is an object, as its type is a certain class. Although we won't be introducing C++'s objects in this course, we are actually using some of the predefined ones.

Ok, now for the big event. Copy /home/comp210/public_html/Labs/lab13/error5.cc to your directory. Compile it -- it reports an error, so you need to fix it. Now try compiling it -- it reports some more errors! The first time around, the compiler became sufficiently confused by the first error that it gave up looking for any more. Now that you've fixed that, it looked for and found more errors. You need to fix these. Repeat until you get a working (if silly) program.