Click here to Skip to main content
15,914,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Any way to keep console.exe open? Pin
Peter Weyzen28-Jun-03 17:18
Peter Weyzen28-Jun-03 17:18 
GeneralRe: Any way to keep console.exe open? Pin
Peter Weyzen29-Jun-03 9:24
Peter Weyzen29-Jun-03 9:24 
GeneralRe: Any way to keep console.exe open? Pin
DaveE9th30-Jun-03 9:27
DaveE9th30-Jun-03 9:27 
GeneralRe: Any way to keep console.exe open? Pin
Toni7829-Jun-03 14:38
Toni7829-Jun-03 14:38 
GeneralMaximum function Pin
Sunnygirl28-Jun-03 12:27
Sunnygirl28-Jun-03 12:27 
GeneralRe: Maximum function Pin
Melekor28-Jun-03 13:43
Melekor28-Jun-03 13:43 
GeneralRe: Maximum function Pin
peterchen28-Jun-03 14:29
peterchen28-Jun-03 14:29 
GeneralRe: Maximum function Pin
majian40528-Jun-03 17:22
majian40528-Jun-03 17:22 
Use macro is not a good choice.You can find this in <<effective c++="">> Item 1 :

#define max(a,b) ((a) > (b) ? (a) : (b))
This little number has so many drawbacks, just thinking about them is painful. You're better off playing in the freeway during rush hour.

Whenever you write a macro like this, you have to remember to parenthesize all the arguments when you write the macro body; otherwise you can run into trouble when somebody calls the macro with an expression. But even if you get that right, look at the weird things that can happen:

int a = 5, b = 0;
max(++a, b); // a is incremented twice
max(++a, b+10); // a is incremented once
Here, what happens to a inside max depends on what it is being compared with!
GeneralRe: Maximum function Pin
peterchen29-Jun-03 1:03
peterchen29-Jun-03 1:03 
GeneralRe: Maximum function Pin
Toni7828-Jun-03 14:04
Toni7828-Jun-03 14:04 
GeneralRe: Maximum function Pin
ZoogieZork28-Jun-03 14:46
ZoogieZork28-Jun-03 14:46 
GeneralDynamic Matrix! Pin
Sunnygirl28-Jun-03 10:54
Sunnygirl28-Jun-03 10:54 
GeneralRe: Dynamic Matrix! Pin
Neville Franks28-Jun-03 11:48
Neville Franks28-Jun-03 11:48 
GeneralRe: Dynamic Matrix! Pin
MAAK28-Jun-03 12:10
MAAK28-Jun-03 12:10 
GeneralRe: Dynamic Matrix! Pin
Toni7828-Jun-03 14:11
Toni7828-Jun-03 14:11 
GeneralRe: Dynamic Matrix! Pin
Peter Weyzen28-Jun-03 17:21
Peter Weyzen28-Jun-03 17:21 
GeneralRe: Dynamic Matrix! Pin
Toni7829-Jun-03 14:42
Toni7829-Jun-03 14:42 
GeneralRe: Dynamic Matrix! Pin
Peter Weyzen29-Jun-03 19:53
Peter Weyzen29-Jun-03 19:53 
GeneralRe: Dynamic Matrix! (I am wrong) Pin
MAAK29-Jun-03 5:40
MAAK29-Jun-03 5:40 
Generalthe cheapest computer books Pin
chester16328-Jun-03 10:20
chester16328-Jun-03 10:20 
GeneralRe: the cheapest computer books - Beware SPAM Pin
Neville Franks28-Jun-03 11:49
Neville Franks28-Jun-03 11:49 
GeneralRe: the cheapest computer books Pin
Trollslayer28-Jun-03 12:01
mentorTrollslayer28-Jun-03 12:01 
GeneralRe: the cheapest computer books Pin
Toni7828-Jun-03 12:06
Toni7828-Jun-03 12:06 
GeneralTab order in win32 dialog Pin
Melekor28-Jun-03 9:02
Melekor28-Jun-03 9:02 
GeneralRe: Tab order in win32 dialog Pin
Michael Dunn28-Jun-03 9:49
sitebuilderMichael Dunn28-Jun-03 9:49 

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.