Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main_array.cpp: In function ‘int main(int, const char**)’:
- main_array.cpp:12:12: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘Array’)
- std::cout << mya;
- ostream& operator<<(ostream& output, Array const& data)
- {
- for (int i = 0 ; i < data.size() ;i++)
- {
- output << data.at(i);
- }
- return output;
- int main(int argc, char const *argv[])
- {
- Array mya(2); //creates 0`s array
- std::cout << mya;
- return 0;
- }
Add Comment
Please, Sign In to add comment