Guest User

Untitled

a guest
Nov 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. main_array.cpp: In function ‘int main(int, const char**)’:
  2. main_array.cpp:12:12: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘Array’)
  3. std::cout << mya;
  4.  
  5. ostream& operator<<(ostream& output, Array const& data)
  6. {
  7. for (int i = 0 ; i < data.size() ;i++)
  8. {
  9. output << data.at(i);
  10. }
  11.  
  12. return output;
  13.  
  14. int main(int argc, char const *argv[])
  15. {
  16.  
  17. Array mya(2); //creates 0`s array
  18.  
  19. std::cout << mya;
  20.  
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment