Click here to Skip to main content
15,927,744 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to use standard bitmaps in a toolbar Pin
kitty524-Jul-06 2:50
kitty524-Jul-06 2:50 
GeneralRe: How to use standard bitmaps in a toolbar Pin
Franken24-Jul-06 3:14
Franken24-Jul-06 3:14 
GeneralRe: How to use standard bitmaps in a toolbar [modified] Pin
kitty524-Jul-06 3:22
kitty524-Jul-06 3:22 
AnswerThe "brute force & pig ignorance" solution Pin
normanS24-Jul-06 19:57
normanS24-Jul-06 19:57 
QuestionType Cast Problem Pin
Uday Janaswamy24-Jul-06 2:02
Uday Janaswamy24-Jul-06 2:02 
AnswerRe: Type Cast Problem Pin
Chris Losinger24-Jul-06 2:13
professionalChris Losinger24-Jul-06 2:13 
GeneralRe: Type Cast Problem Pin
Uday Janaswamy24-Jul-06 2:30
Uday Janaswamy24-Jul-06 2:30 
AnswerRe: Type Cast Problem Pin
Stephen Hewitt24-Jul-06 13:53
Stephen Hewitt24-Jul-06 13:53 
Chris is correct of course; 'y' is unsigned while 'x' is signed. If you check the output window in your IDE the compiler should have issued warnings indicating that you're mixing signed and unsigned values in the assignment and comparison. The reason -1 is actually interpreted as the largest positive number relates to how 2's compliment arithmetic works; you may want to look this up if you’re curious. You used a type cast to fix the problem ; while this works a better solution (if appropriate) would be to simply make 'y' signed. I would also suggest that if you must type cast use static_cast instead of a C-style cast. e.g.
static_cast<int>(y)


There are many reasons to prefer C++ casting operators to C-style casts: in this case visibility applies (in other casting examples there are more pressing reasons to prefer C++ casting operators).
Questionstring trim Pin
tanarnelinistit24-Jul-06 1:44
tanarnelinistit24-Jul-06 1:44 
AnswerRe: string trim Pin
_AnsHUMAN_ 24-Jul-06 2:00
_AnsHUMAN_ 24-Jul-06 2:00 
AnswerRe: string trim Pin
James R. Twine24-Jul-06 3:03
James R. Twine24-Jul-06 3:03 
GeneralRe: string trim Pin
Blake Miller24-Jul-06 12:13
Blake Miller24-Jul-06 12:13 
GeneralRe: string trim Pin
James R. Twine24-Jul-06 14:09
James R. Twine24-Jul-06 14:09 
AnswerRe: string trim Pin
David Crow24-Jul-06 4:14
David Crow24-Jul-06 4:14 
AnswerRe: string trim Pin
Zac Howland24-Jul-06 6:29
Zac Howland24-Jul-06 6:29 
AnswerRe: string trim Pin
James R. Twine24-Jul-06 8:10
James R. Twine24-Jul-06 8:10 
QuestionDatabase connection in vc++ Pin
ningthemcha24-Jul-06 1:04
ningthemcha24-Jul-06 1:04 
AnswerRe: Database connection in vc++ Pin
_AnsHUMAN_ 24-Jul-06 1:19
_AnsHUMAN_ 24-Jul-06 1:19 
AnswerRe: Database connection in vc++ Pin
David Crow24-Jul-06 2:59
David Crow24-Jul-06 2:59 
QuestionDisplaying the content of control to new form contron Pin
ningthemcha24-Jul-06 1:02
ningthemcha24-Jul-06 1:02 
AnswerRe: Displaying the content of control to new form contron Pin
_AnsHUMAN_ 24-Jul-06 2:33
_AnsHUMAN_ 24-Jul-06 2:33 
AnswerRe: Displaying the content of control to new form contron Pin
Hamid_RT24-Jul-06 2:41
Hamid_RT24-Jul-06 2:41 
QuestionRe: Displaying the content of control to new form contron Pin
David Crow24-Jul-06 3:03
David Crow24-Jul-06 3:03 
Questionasynchronized I/O == multiplexing I/O? Pin
George_George24-Jul-06 0:57
George_George24-Jul-06 0:57 
AnswerRe: asynchronized I/O == multiplexing I/O? Pin
peterchen24-Jul-06 2:12
peterchen24-Jul-06 2:12 

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.