Thread: Overloading

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669
    I already have this method "operator const char *() { return text; }" and it is not working. I still get the address instead of the actual text.

    Any other suggestions?


    I like pie too .
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >and it is not working
    You aren't doing something right then. But that's a moot issue anyway because using an implicit conversion overload is fraught with danger (and everyone knows that you can't argue with a statement that uses the word fraught).

    >Any other suggestions?
    Overload the << operator as Thantos suggested.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Overloading operators
    By ugmusicbiz in forum C++ Programming
    Replies: 2
    Last Post: 02-13-2009, 01:41 PM
  2. unary operator overloading and classes
    By coletek in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2009, 02:14 AM
  3. overloading operator problems
    By almich in forum C++ Programming
    Replies: 2
    Last Post: 07-26-2004, 04:10 PM
  4. operator overloading
    By blue_gene in forum C++ Programming
    Replies: 6
    Last Post: 04-29-2004, 04:06 PM
  5. overloading
    By theLukerBoy in forum C++ Programming
    Replies: 6
    Last Post: 11-04-2002, 08:49 PM