Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
1

123dave123

@123dave123
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help with this program
    1 123dave123

    hey guys, i'm pretty new to C++ and have a program i'm trying to write. i basically have the .h file done except for the private data members. the project instructions are below as well as what i have of the .h file. i'm sure you guys probably think this is easy but if anyone can do it so atleast i have something to refer to i'd aprecitae it. thanks Your job is to implement and test this ADT using an array allocated with the new operator in the constructors and de-allocated with the delete [] operator in the destructor. You will find that three data members will be sufficient for the job. At a minimum, you must test each function with enough different arguments to show it works. You are allowed to define additional helper functions, member functions or otherwise //--------------------------------------------------------------------------- #ifndef MyStringH #define MyStringH //--------------------------------------------------------------------------- typedef char CharType; // Allow for other character types class String { public: // Constructors and Destructor String( int capacity = 50 ); // Make empty String with given capacity String( const String & str ); // Copy str String( const CharType * str, int capacity = 50 ); // Make str a String ~String(); // Queries unsigned Length() const { return count_; } bool IsEmpty() const { return (count_ == 0); } bool IsFull() const { return count_ == capacity_; } int IndexOf( const String & str ); String SubString( unsigned start, unsigned count ) const; // Copy out const CharType * c_str() const; // Modifiers CharType & operator[]( int index ) { return string_[index]; } // Unsafe bool Delete( unsigned start, unsigned count ); bool Insert( unsigned pos, const String & str ); private: I NEED THE PRIVATE DATA MEMBERS FOR HERE }; //--------------------------------------------------------------------------- #endif thanks again :)

    C / C++ / MFC c++ database data-structures help career
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups