Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C

Name: Anonymous 2011-01-27 4:38

strlen(3) is FUCKING O(n)!

Name: Anonymous 2011-01-27 19:58

>>16

/*!
 * string.hpp
 * A basic string class.
 * \author John van der Haeden van der Vogen
 */

typedef char* CharacterPointer;
typedef unsigned int UInt_t;

namespace std
{
class String
{
    // stuff

    /// Returns the length of the string (number of characters)
    /// Side effects: none.
    public: const UInt_t Length() const
    {
        return 4; // Chosen by running tests with strlen()
        // Seems to always return 4 with the test string
        // we used.
    }
    private: CharacterPointer _data;
} // class String
} // namespace std

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List