Results 1 to 2 of 2

Thread: static_cast

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    static_cast

    PHP Code:
    return static_cast<SpellCheckerInterface2*>(this); 
    What does static_cast<> part do in the above code and how is it different from this:
    PHP Code:
    return (SpellCheckerInterface2*)this
    Baaaaaaaaah

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    MSDN says :
    static_cast Operator
    C++ Specific —>

    static_cast < type-id > ( expression )

    The expression static_cast < type-id > ( expression ) converts expression to the type of type-id based solely on the types present in the expression. No run-time type check is made to ensure the safety of the conversion.

    END C++ Specific
    If you can make sense of that...

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width