-
break or return
It might be a dumb question but its confusing me at times,
when to use "break" and when to use "return 0", in responce to some window messages like WM_VSCROLL .ie
,,,,,,,,,,,,,,,,
case SB_TOP:
process,,,,,
break;
or in regard to some other messages at times choosing either one makes no difference at all,.i know that by sending return 0 you are telling the win that u have orocessed the message but doesnt break statement do the same thing?
-
as a rule, I try to make my functions have ONE exit point. this should be at the end of the function. therefore you would always use break in your case statement.
-
i always return right away. if you break and you know that it will definitely return, then it will just be easier to follow/debug. to see a break and tehn follow the break is just rediculous if you just return after the break.
make things as clear as possible! :)