cout error??(c++)

This topic is 4819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Uh... How are these three couts having error?(the variables have been declared,yes.) cout<<xando[0]<<xando[1]<<xando[2]<<endl;<<xando[3]<<xando[4]<<xando[5]<<endl;<<xando[6]<<xando[7]<<xando[8]<<endl;<<endl;<<endl; cout<<xando[0]<<xando[1]<<xando[2]<<endl;<<xando[3]<<xando[4]<<xando[5]<<endl;<<xando[6]<<xando[7]<<xando[8]<<endl;<<endl;<<endl; cout<<xando[0]<<" has won!";<<endl;

Share on other sites
You have extra ;'s in the middle of your statements. Get rid of the ;'s after all but the last endl on each line.

Share on other sites
Quote:
 Original post by supercrazy7474Uh... How are these three couts having error?(the variables have been declared,yes.)cout<

dear lord, tidy that up

#include <cstddef>#include <algorithm>#include <iterator>#include <iostream>int main() {   const int foo[] = { 3, 4, 5, 6, 345, 54 };   const size_t N = sizeof(foo) / sizeof(int);   std::copy(foo, foo + N, std::ostream_iterator<int>(std::cout, ", "));}

Share on other sites
oh.hehe thanks, i forgot how exactly how to use endl.