#include<iostream>
using namespace std;
int main()
{
ostream os=cout;
os<<"ABC";
}
This is giving me compilation error.
#include<iostream>
using namespace std;
int main()
{
ostream os=cout;
os<<"ABC";
}
This is giving me compilation error.
Try this instead:
#include<iostream>
using namespace std;
int main()
{
ostream& os = cout;
os << "ABC"<< endl;
}
ostream& os = cout;
declares a reference to cout
called os
.
You will surely get an error as you cannot directly assign it to count... You will need to link it with the reference of ostream...
Can you change the line:
ostream os=cout;
to
ostream & os = cout
Hope it help you then...