Day 2 of teach yourself ansi bastardization in 21 days has this piece of code
Code:
#include <iostream.h>
int Add (int x, int y)
{
cout << “In Add(), received “ << x << “ and “ << y << “\n”;
return (x+y);
}
void main()
{
cout << “I’m in main()!\n”;
int a, b, c;
cout << “Enter two numbers: “;
cin >> a;
cin >> b;
cout << “\nCalling Add()\n”;
c=Add(a,b);
cout << “\nBack in main().\n”;
cout << “c was set to “ << c;
cout << “\nExiting...\n\n”;
}
When trying to compile it, there are all sorts of errors. I moved on to another book after seeing that.
I mean if at day 2 they are presenting such sloppy and non-functional code, what will happen in the next 18 days?