Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by an9bit ( 19 years ago )
//String.h
class String {
    public:
        String();
        String(const String&);
        String& operator=(const String&);
        ~String();
        String(const char*);
        String(const int);
        String(const double);
        String operator+(const String&) const;
        String operator+(const char*) const;
        String operator+(const int) const;
        String operator+(const double) const;
        String&operator+=(const String&);
        String&operator+=(const char*);
        String&operator+=(const int);
        String&operator+=(const double);
        String operator==(String&);
        operator char*() const;
        operator int() const;
        operator double() const;
        friend std::ostream& operator<<(std::ostream& o, const String& s){return o << s.rep->rep;}
        int length(void) const;
        int size(void) const {return length();}
        String operator()(int, int);
    private:
        class StringRep{
            public:
                StringRep(const char*);
                ~StringRep();
                char* rep;
                int count;
        };
        StringRep *rep;
};


//String.cxx (&#1082;&#1091;&#1089;&#1086;&#1082;)
bool String::operator==(String&s1){
    return false;
}

 

Revise this Paste

Your Name: Code Language: