Click here to Skip to main content
15,897,226 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Edit Box alignment problem Pin
David Crow19-Jul-06 7:49
David Crow19-Jul-06 7:49 
AnswerRe: Edit Box alignment problem Pin
cppcook19-Jul-06 8:00
cppcook19-Jul-06 8:00 
AnswerRe: Edit Box alignment problem Pin
earl19-Jul-06 8:34
earl19-Jul-06 8:34 
QuestionSyntax Question Pin
pgav19-Jul-06 7:14
pgav19-Jul-06 7:14 
AnswerRe: Syntax Question Pin
Justin Tay19-Jul-06 7:17
Justin Tay19-Jul-06 7:17 
AnswerRe: Syntax Question Pin
toxcct19-Jul-06 7:19
toxcct19-Jul-06 7:19 
GeneralRe: Syntax Question Pin
pgav19-Jul-06 7:25
pgav19-Jul-06 7:25 
AnswerRe: Syntax Question Pin
Zac Howland19-Jul-06 8:54
Zac Howland19-Jul-06 8:54 
pgav wrote:
long comm_fm_node_id(comm_fm_dev_t *dev, long group) {
return (group == 0) ? MCAST_nodeid : -1;
}


By the way, be VERY judicious when using the ternary operator (which is what the expression ? result_if_true : result_if_false is called). Most of the time, it is far more clear to write:

if (expression)
{
	return SomeValue;
}
else
{
	return SomeOtherValue;
}


I can't tell you how many bugs I've run into because people tried to get fancy with the ternary operator and do things like:

return expression1 ? expression2 ? expression4 ? 1 : 0 : 3 : expression3 ? 2 : 4;


If you run into something like that, you should hunt down the person who wrote it, take them out behind your office, and ... well, you get the idea.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac
Questionbrekpointing every function Pin
TClarke19-Jul-06 6:11
TClarke19-Jul-06 6:11 
QuestionWinsocket2 Pin
Jay0319-Jul-06 5:56
Jay0319-Jul-06 5:56 
AnswerRe: Winsocket2 Pin
Zac Howland19-Jul-06 6:06
Zac Howland19-Jul-06 6:06 
AnswerRe: Winsocket2 Pin
David Crow19-Jul-06 6:11
David Crow19-Jul-06 6:11 
AnswerRe: Winsocket2 Pin
earl19-Jul-06 6:39
earl19-Jul-06 6:39 
GeneralRe: Winsocket2 Pin
Jay0319-Jul-06 7:29
Jay0319-Jul-06 7:29 
QuestionHelp moving from VC6 to VC8, command line Pin
jasper7719-Jul-06 5:54
jasper7719-Jul-06 5:54 
AnswerRe: Help moving from VC6 to VC8, command line Pin
jasper7719-Jul-06 10:41
jasper7719-Jul-06 10:41 
Questiondefault buttons Pin
aafcls19-Jul-06 5:18
aafcls19-Jul-06 5:18 
AnswerRe: default buttons Pin
toxcct19-Jul-06 5:22
toxcct19-Jul-06 5:22 
GeneralRe: default buttons Pin
aafcls19-Jul-06 6:13
aafcls19-Jul-06 6:13 
GeneralRe: default buttons Pin
toxcct19-Jul-06 6:19
toxcct19-Jul-06 6:19 
GeneralRe: default buttons Pin
David Crow19-Jul-06 7:36
David Crow19-Jul-06 7:36 
QuestionInvisible Console Window Pin
Dave Kerr19-Jul-06 4:42
Dave Kerr19-Jul-06 4:42 
AnswerRe: Invisible Console Window Pin
Ali Rafiee19-Jul-06 6:54
Ali Rafiee19-Jul-06 6:54 
GeneralRe: Invisible Console Window Pin
Dave Kerr19-Jul-06 22:48
Dave Kerr19-Jul-06 22:48 
QuestionProblem when using a prolific USB to serail adapter. Pin
Lifeson19-Jul-06 4:32
Lifeson19-Jul-06 4:32 

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.