ya********@gmail.com wrote:
Why won't this code compile?
#include <iostream.h>
^^^^^^^^^^
Because this is not a standard C (or C++) header?
void Print(int i);
void Print(float f, int skip = 0);
void main()
^^^^
Because main returns an int, and there is no excuse for this Schildtism?
{
Print(3.3);
}
void Print(int i)
{
cout << "Integer" << endl;
^^^^ ^^^^^^^ ^^^^
Because you are app;ying left-shift operators to undefined variables
(cout and endl) and to a string literal ("Integer")?
}
void Print(float f, int skip)
{
cout << "Float";
Because you are attempting to left shift an undefined variable (cout)
by something not an integral scalar?
if (skip != 0)
cout << endl;
Again.
}
If you cna't figure out what language you are attempting to misuse, then
it is no wonder that you can't write compilable code.
>