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. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help with this program

Help with this program

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasedata-structureshelpcareer
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 1 Offline
    1 Offline
    123dave123
    wrote on last edited by
    #1

    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 :)

    U T P 3 Replies Last reply
    0
    • 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 :)

      U Offline
      U Offline
      User 1305173
      wrote on last edited by
      #2

      Will Try to help you out. :doh: Luckyhuss

      1 Reply Last reply
      0
      • 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 :)

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        homework ?! do it your self !!! we are here to help, no to do your job...


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        1 Reply Last reply
        0
        • 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 :)

          P Offline
          P Offline
          pc_dev
          wrote on last edited by
          #4

          You are allowed to define additional helper functions, member functions or otherwise:):-D:laugh:;);P

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

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