Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyString
- {
- char* m_pStr;
- public:
- MyString();
- MyString(char* string);
- friend ostream& operator<<(ostream& os, const MyString& string);
- };
- //Global.h
- #include <iostream>
- #include "myString.h"
- using namespace std;
- ostream& operator<<(ostream& os, const MyString& string); (сюда пишет ошибку missing type specifier - int assumed. Note: C++ does not support default-int)
- //Global.cpp
- #include "Global.h"
- ostream& operator<<(ostream& os,const MyString& string)
- {
- os << string.m_pStr (не могу так написать, потому что компилятор не видит этого поля, почему ??) ;
- return os;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement