Thread: Text RPG - Overloading Operators

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The general rule of thumb is prefix operator, unless you actually need a postfix.

  2. #2
    Student legit's Avatar
    Join Date
    Aug 2008
    Location
    UK -> Newcastle
    Posts
    156
    Quote Originally Posted by tabstop View Post
    The general rule of thumb is prefix operator, unless you actually need a postfix.
    Thanks, that's easier of the 2 in my oppinion anyways

    [edit]
    I have overloaded it

    Code:
    StatsMgr& StatsMgr::operator++()
    {
        ++PlayerLevel;
        return *this;
    }
    What does everyone think? Is it alright?
    Last edited by legit; 11-25-2008 at 01:04 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 10-27-2007, 12:42 PM
  2. text rpg help
    By xxwerdxx in forum Game Programming
    Replies: 1
    Last Post: 11-26-2005, 08:16 PM
  3. How to use FTP?
    By maxorator in forum C++ Programming
    Replies: 8
    Last Post: 11-04-2005, 03:17 PM
  4. Overloading compound operators?
    By Nyda in forum C# Programming
    Replies: 2
    Last Post: 04-28-2004, 05:42 AM
  5. Check out My Text Rpg Game
    By knight543 in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2002, 10:40 PM