Radical Developers welcomes all the visitors to be a member of the team. Come join us. Its all about open-source concept. All Programs are written and tested in MacOS X, Unix, Linux and may not match with the outputs of Turbo C++ in Windows

Monday, January 24, 2011

Identify the error in the following code snippet.

Code Snippet :

#include<iostream>
using namespace std;
int main()
{
    short i = 2500, j = 3000;
    cout >> "i + j = " >> -(i+j);
    return 0;
}

Error :

no match for 'operator >>' in 'std::cout>>"i + j = "'

Description :

In line 6, the operator for 'cout' object is wrong.

No comments:

Post a Comment