What could be the error?

std::cout << (float)5/8 << std:endl; 

error C2882: 'std': illegal use of namespace identifier in expression

Closed due to the fact that off-topic participants Harry , user194374, pavel , αλεχολυτ , Qwertiy 19 Jan '17 at 21:29 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Harry, Community Spirit, pavel, αλεχολυτ, Qwertiy
If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    Everything is very simple - I missed the second colon.

    • I will support It also turned out that std::endl can be std::endl and often use "\n" instead. Although the difference is only in two points - std::endl more portable option and it drops the cout 's buffer. - gecube
    • @gecube And so much slower ... - Harry

    In general, it is best to include the std at the beginning of the program:

     using namespace std; 
    • 2
      Use "using namespace <namespace name>;" not recommended as it foul up the global namespace. - andrybak
    • one
      @Andrey, if only one space is used, then your comment is superfluous, it’s not convenient for everyone to write std :: each time, especially if I know from experience how many times in the code. - 3JIoi_Hy6