[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppMacro

(C++) Macro

A preprocessor function.

Avoid macro's [1,2].

//Macro function
  1. define MAX(A,B) ( A > B ? A : B )
//Correct C++ alternative template <typename T> inline T max(const T& a, const T& b) return ( a > b ? a : b);


One of the few exceptions is the assert statement, which can be used for debugging.

C++ Standard macro’s [3]

_IOFBF
_IOLBF
_IONBF
assert 
BUFSIZ 
CLOCKS_PER_SEC 
EDOM 
EOF 
ERANGE 
errno 
EXIT_FAILURE 
EXIT_SUCCESS 
FILENAME_MAX 
FOPEN_MAX 
HUGE_VAL 
L_tmpnam 
LC_ALL 
LC_COLLATE 
LC_CTYPE 
LC_MONETARY 
LC_NUMERIC 
LC_TIME 
MB_CUR_MAX 
NULL (in cstddef) 
NULL (in cstdio) 
NULL (in cstring) 
NULL (in ctime) 
NULL (in cwchar) 
offsetof 
RAND_MAX 
SEEK_CUR 
SEEK_END 
SEEK_SET 
setjmp 
SIG_DFL 
SIG_ERR 
SIG_IGN 
SIGABRT 
SIGFPE 
SIGILL 
SIGINT 
SIGSEGV 
SIGTERM 
stderr 
stdin 
stdout 
TMP_MAX
va_arg
va_end
va_start
WCHAR_MAX
WCHAR_MIN
WEOF (in cwchar)
WEOF (in cwctype)


'Macro' links

References



last edited (November 29, 2006) by bilderbikkel, Number of views: 3177, Current Rev: 9 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.