Click here to Skip to main content
15,925,505 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: array -- foo, &foo and &foo[0] Pin
jimfisher14-Aug-07 5:45
jimfisher14-Aug-07 5:45 
GeneralRe: array -- foo, &foo and &foo[0] Pin
George_George14-Aug-07 16:11
George_George14-Aug-07 16:11 
AnswerRe: array -- foo, &foo and &foo[0] Pin
Iain Clarke, Warrior Programmer13-Aug-07 22:46
Iain Clarke, Warrior Programmer13-Aug-07 22:46 
GeneralRe: array -- foo, &foo and &foo[0] Pin
George_George13-Aug-07 23:23
George_George13-Aug-07 23:23 
GeneralRe: array -- foo, &foo and &foo[0] Pin
Iain Clarke, Warrior Programmer13-Aug-07 23:36
Iain Clarke, Warrior Programmer13-Aug-07 23:36 
GeneralRe: array -- foo, &foo and &foo[0] Pin
George_George13-Aug-07 23:50
George_George13-Aug-07 23:50 
QuestionDisabling shortcut in Visual C++ [modified] Pin
jimfisher13-Aug-07 18:15
jimfisher13-Aug-07 18:15 
AnswerRe: Disabling shortcut in Visual C++ Pin
Iain Clarke, Warrior Programmer13-Aug-07 22:56
Iain Clarke, Warrior Programmer13-Aug-07 22:56 
Its pretty deep in the assumptions of C that you will have this shortcutting behaviour, and as you mention, is very useful.

ie.

if (pointer && pointer->otherpointer)
{
   ...
}


would crash if pointer was null, and there wasn't this shortcutting behaviour.

I'm assuming that A and B are complex expressions, or function calls.

In which case you can do...

BOOL A = Something_I_Insist_On_Being_Done ();
BOOL B = Other_Thing ();

if (A || B)
{
   ...
}


If a compiler flag did exist then you'd have terrible trouble understanding why you used it when you look back in two years time. To avoid that, you'd end up writing so many comments you may as well have done the preconditions early as I did in my example.

Iain.

ps. Never forget the impact on your successor - especially as that may be you on a monday morning with a hangover...



QuestionRe: Disabling shortcut in Visual C++ Pin
David Crow14-Aug-07 3:12
David Crow14-Aug-07 3:12 
AnswerRe: Disabling shortcut in Visual C++ Pin
jimfisher14-Aug-07 5:20
jimfisher14-Aug-07 5:20 
Questionfatal error C1001: INTERNAL COMPILER ERROR Pin
itkid13-Aug-07 18:11
itkid13-Aug-07 18:11 
AnswerRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
jimfisher13-Aug-07 18:20
jimfisher13-Aug-07 18:20 
GeneralRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
itkid15-Aug-07 20:35
itkid15-Aug-07 20:35 
Questionhow to know a double is infinite directly? Pin
includeh1013-Aug-07 18:00
includeh1013-Aug-07 18:00 
GeneralRe: how to know a double is infinite directly? Pin
Maxwell Chen13-Aug-07 19:04
Maxwell Chen13-Aug-07 19:04 
AnswerRe: how to know a double is infinite directly? Pin
Mark Salsbery14-Aug-07 6:05
Mark Salsbery14-Aug-07 6:05 
QuestionApplication that use DataGrid ActiveX Control dont work without VC++ installed Pin
xanagan13-Aug-07 17:13
xanagan13-Aug-07 17:13 
AnswerRe: Application that use DataGrid ActiveX Control dont work without VC++ installed Pin
Maxwell Chen13-Aug-07 17:46
Maxwell Chen13-Aug-07 17:46 
AnswerRe: Application that use DataGrid ActiveX Control dont work without VC++ installed Pin
Paresh Chitte13-Aug-07 18:51
Paresh Chitte13-Aug-07 18:51 
GeneralVisual Studio 2003/2005 name mangling Pin
Harald Krause13-Aug-07 15:42
Harald Krause13-Aug-07 15:42 
GeneralRe: Visual Studio 2003/2005 name mangling Pin
Maxwell Chen13-Aug-07 17:08
Maxwell Chen13-Aug-07 17:08 
QuestionDrawing Data Flow Digram Pin
Rajesh Rajan Pankapattu13-Aug-07 8:48
Rajesh Rajan Pankapattu13-Aug-07 8:48 
QuestionObtain class digram Pin
Rajesh Rajan Pankapattu13-Aug-07 8:36
Rajesh Rajan Pankapattu13-Aug-07 8:36 
QuestionDesign question for using derived class/ Multiple Base classes Pin
ForNow13-Aug-07 6:36
ForNow13-Aug-07 6:36 
AnswerRe: Design question for using derived class/ Multiple Base classes Pin
jhwurmbach13-Aug-07 6:47
jhwurmbach13-Aug-07 6:47 

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.