Thread: Need a problem

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    450

    Need a problem

    I have been reading about friends classes, virtual functions, containment and virtual classes now I need a simple problem that will force me to code in some of these concepts and ideas. Any input will be much appreciated. Remember I am still a newbie though I think some of these concepts are fairly advanced.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    If you need practice with just plain ol' simple classes first, write a linked list class.

    Otherwise, you could try something like a "big numbers" class (overloaded operators to handle larger numbers that doubles).

    Just some ideas.
    Away.

  3. #3
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    try what I'm doing: write a battle system...

    mine will be able to handle:

    [list=1][*]creating users[*]assigning stats to new users[*]battling[*]healing (spending money)[*]checking stats[*]leveling[*]money[*]hp[*]exp[*]lvl[*]password[/list=1]

    there's other stuff in there too, but I don't really remember now... I'm only using classes out of the things you listed, but I guess you could try to make it happen...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #4
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    Thanks for the input. The book I am studying implements a linked list class so that is out. The Big numbers problem sounds great, but shweww it also sounds over my head thinking about it I do not have a clue though I do know how to overload operators. I like the idea of a battle system.

    I had a thought I was creating a character generating program and I wanted to check the stats Race, Armortype, Profession from a list of valid options in a file. Would a friends class work well for this. This would seperate the char generation and and validation sections could be implemented in there own class. For instance I had a string array of valid Professions which would be better off in a friends class because it really isn't part of the charachter class, then I could implement functions like isValidProffesion. What do you think?
    Last edited by curlious; 07-28-2003 at 07:13 AM.

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    you lost me in there...

    be wary about the battle system... it's easy if you plan it out right and follow your plans, but if you change midstream, the big numbers program will look easy... the big numbers program is usually taught before something like this, or leading up to something like this...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  6. #6
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    Big numbers

    Find a way to contain bigger numbers.
    I.E. Array/String or multiple Integers, you decide

    then create a system to perform operations on them by making functions in this class.

    Then after the class is all done you can add overloaded operators.
    Ex:
    Code:
    bigInt bigInt::operator +(bigInt rint)
    {
    	return add(*this,rint);
    }


    -LC
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM