Creating a Custom String Class

This is a discussion on Creating a Custom String Class within the C++ Programming forums, part of the General Programming Boards category; DELETED!!! Too much code....

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    37

    Creating a Custom String Class

    DELETED!!! Too much code.
    Last edited by kisiellll; 10-03-2009 at 09:38 AM.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    to be honest, i dont think you will get much help from this post, because theres way too much stuff! your description is quite long, and there is also a large amount of code, and i dont think many people would take the time to go through it all (i know im not that patient).

    i would suggest you edit your initial post including only relevant information and code. it appears you have some assignment you have to do and youre having trouble doing it. pick a specific part of your assignment that you have tried to implement it and ran into problems, and describe what you want it to do, what it is doing, and what youre telling it to do (i.e. the relevant code),

    hope it helps.

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    You've also posted your professor's test code, but your own work is really in a rudimentary stage and doesn't show any problems that you might have.

    A suggestion: work at one function at a time, but perhaps don't initially try to compile it against the "main.cpp", since most of the functionality will be missing. Or declare all the functions to begin with, so you can see if main.cpp is going to compile with your declaration.

    In any case, compile your code often (after writing each function or even more often). Don't write it all at once and then end up with hundreds of errors.

    If you have hundreds of errors, you'll need to start with the first. Fix that, then compile again. Often the following errors result from the first one and it certainly doesn't mean there is 100s of unique syntax errors for you to fix. (I don't know your abilities, though.)

    It would also help to test code as soon as possible. Try to test each function before implementing the next (you could try to use your main for that: you'll need to determine which functions you need first to test other - like equals, etc, and you might need to write stubs for others.)
    Last edited by anon; 10-03-2009 at 04:44 AM.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Backup the main.cpp, then make your own main.cpp that only contains the tests for the stuff you've already written. Whenever you add a new function, add the relevant test snippet from the original main.cpp to your own.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    37
    yeah i kind of knew it was alot at once. well its a new morning here so im back at it again. ill wait till i reach some problems before requesting help.

    thanks for the tips so far though. being a beginner at C++, this professor can give kind of overwhelming assignments considering the length of the code im looking at. but i think i will make do.

  6. #6
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    when i saw that you completely deleted the first post, i thought it was a sign you "gave up" and i was initially upset that you might have taken what i said the wrong way. thankfully after seeing your other post it appears your going at it again from a different, more iterative/step-by-step approach. keep it up and, again, when you run into a specific problem, let us know (with relevant information, examples, compiler messages, etc).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 10:33 PM
  2. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  3. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM
  4. Creating a string class
    By incognito in forum C++ Programming
    Replies: 2
    Last Post: 01-19-2002, 05:40 PM
  5. Replies: 3
    Last Post: 12-03-2001, 01:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21