The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C++ Code
Posted by: bk | June 2, 2010 @ 10:09pm
C++ Code
[
Download
]
#ifndef STRING_H_ #define STRING_H_ #include <iostream> namespace ctm { class string { private: char *str; //pointer to string int len; //length of string static int num_strings; //number of objects static const int CINLIM = 80; //cin input limit public: //constructors and other methods string(const char *s); //constructor string(); //default constructor string(const string &st); //copy constructor ~string(); //destructor int length() const { return len; } //overloaded operator methods string &operator=(const string &); string &operator=(const char *); char &operator[](int i); const char &operator[](int i) const; //overloaded operator friends friend bool operator<(const string &st, const string &st2); friend bool operator>(const string &st, const string &st2); friend bool operator==(const string &st, const string st2); friend std::ostream &operator>>(std::ostream &os, const string &st); friend std::istream &operator<<(std::istream &is, string &st); //static function static int HowMany(); }; } #endif
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.56 / 8
39 Votes
http://codebin.yi.org/666
page generated in 0.01 seconds