Click here to Skip to main content
15,896,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dumb question.. Pin
Alvaro Mendez19-Nov-02 6:02
Alvaro Mendez19-Nov-02 6:02 
GeneralRe: Dumb question.. Pin
RobJones19-Nov-02 6:09
RobJones19-Nov-02 6:09 
Generalstatic_cast Pin
Jon Hulatt19-Nov-02 5:14
Jon Hulatt19-Nov-02 5:14 
GeneralRe: static_cast Pin
Joaquín M López Muñoz19-Nov-02 5:33
Joaquín M López Muñoz19-Nov-02 5:33 
GeneralRe: static_cast Pin
Jon Hulatt19-Nov-02 5:52
Jon Hulatt19-Nov-02 5:52 
GeneralRe: static_cast Pin
Tim Smith19-Nov-02 6:04
Tim Smith19-Nov-02 6:04 
GeneralRe: static_cast Pin
Paul M Watt19-Nov-02 10:05
mentorPaul M Watt19-Nov-02 10:05 
GeneralRe: static_cast Pin
Patje19-Nov-02 21:17
Patje19-Nov-02 21:17 
Doesn't that depend on the type of casting performed?
E.g. Take the following C lines:
myInt     = (int)myFloat;<br />
myCharPtr = (char *)myVoidPtr;

I would use static_cast for the first one, and reinterpret_cast for the second one.

If I would use
myInt = reinterpret_cast<int>myFloat;wouldn't that cause the compiler to intepret the bit-pattern of myFloat as the bit-pattern of an int, causing garbage to be assigned to myInt?

That leaves me with the other two casts:
const_cast: for casting way the const (wouldn't volatile_cast be a better name?)
dynamic_cast: for casting instance-pointers from one type to another, checking dynamically whether it is the correct type or not.

<marquee>Enjoy life, this is not a rehearsal !!!
GeneralCrash in CReBar::AddBar() under .Net Pin
pvlasie19-Nov-02 4:39
pvlasie19-Nov-02 4:39 
QuestionWhere custom ie toolbar is located? Pin
Weiye Chen19-Nov-02 4:17
Weiye Chen19-Nov-02 4:17 
AnswerRe: Where custom ie toolbar is located? Pin
Chris Hambleton19-Nov-02 11:54
Chris Hambleton19-Nov-02 11:54 
GeneralDigital timer MFC/C++ Pin
Justina0119-Nov-02 3:39
Justina0119-Nov-02 3:39 
GeneralRe: Digital timer MFC/C++ Pin
RobJones19-Nov-02 5:31
RobJones19-Nov-02 5:31 
GeneralRe: Digital timer MFC/C++ Pin
valikac19-Nov-02 7:26
valikac19-Nov-02 7:26 
Generaldouble channels in ISDN Pin
Tili19-Nov-02 3:37
Tili19-Nov-02 3:37 
GeneralKeyboard input trouble Pin
s o v a n n19-Nov-02 3:05
s o v a n n19-Nov-02 3:05 
GeneralRe: Keyboard input trouble Pin
benjymous19-Nov-02 3:44
benjymous19-Nov-02 3:44 
GeneralRe: Keyboard input trouble Pin
Jason Henderson19-Nov-02 3:48
Jason Henderson19-Nov-02 3:48 
GeneralRe: Keyboard input trouble Pin
benjymous19-Nov-02 5:21
benjymous19-Nov-02 5:21 
GeneralPassword Filter under Win2k Pin
Lhenno Ferrari19-Nov-02 2:30
Lhenno Ferrari19-Nov-02 2:30 
GeneralRe: Password Filter under Win2k Pin
benjymous19-Nov-02 3:46
benjymous19-Nov-02 3:46 
GeneralRe: Password Filter under Win2k Pin
Lhenno Ferrari20-Nov-02 1:06
Lhenno Ferrari20-Nov-02 1:06 
Generalchanging the text in tabs Pin
Luke Murray19-Nov-02 1:50
Luke Murray19-Nov-02 1:50 
GeneralRe: changing the text in tabs Pin
Roger Allen19-Nov-02 1:59
Roger Allen19-Nov-02 1:59 
GeneralRe: changing the text in tabs Pin
Luke Murray19-Nov-02 2:19
Luke Murray19-Nov-02 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.