Thread: New typecast Style in C++?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    That style of casting is nice because it follows the constructor look and feel.

    I.E.
    Code:
    class Bob {
      public:
        Bob(int);
    };
    Would allow you to do
    Code:
    Bob(10);
    int x;
    Bob(x);
    The only time it gets annoying is with two word type names
    Code:
    unsigned long (x);
    just doesn't work Have to do
    Code:
    (unsigned long)(x);
    And Ancient Dragon you haven't been here long enough to pick on Mister C.

  2. #2
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    And Ancient Dragon you haven't been here long enough to pick on Mister C.
    That's Good to know...
    Mr. C: Author and Instructor

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Quote Originally Posted by Thantos
    And Ancient Dragon you haven't been here long enough to pick on Mister C.
    Old farts like me can pick on anyone I like, thank you very much.

    Code:
     num = int (19.99) + int (11.99);
    I've seen it on very rare occasions. I don't like it and don't use it.
    Last edited by Ancient Dragon; 09-19-2005 at 05:04 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Which style of if loops is most common?
    By dwks in forum A Brief History of Cprogramming.com
    Replies: 38
    Last Post: 08-25-2005, 03:18 PM
  4. WS_EX_COMPOSITED style (double buffering) problems
    By JasonD in forum Windows Programming
    Replies: 2
    Last Post: 10-12-2004, 11:21 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM