![]() |
|
#1
|
|||
|
|||
Definition of a Macro C++what is a macro ? i see a lot of these statement
#defime Max=10; any one can define breifly a macro with an example would be great thanks all. |
|||
|
#2
|
|||
|
|||
Re: Definition of a Macro c++Quote:
Quote:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Macros will make more sense if you learn to use the preprocessor available with whatever compiler you are using. In this manner, you will learn what code the compiler is really compiling after all preprocessor commands have been expanded (This includes #include directives too...). Most frequently, this will be an executable binary entitiled cpp or cpp.exe. Look it up in whatever documentation is available for your particular compiler, & experiment. Once you learn what functionality macros provide, recognize that C++ offers other features which are better & better integrated with the compiler itself -- especially when a debugger is used. Although macros by convention are capitalized, some libraries exist which don't follow this dictum. This can chew up time when a programmer is trying to understand why code isn't functioning as it is expected, & what appears to be a function call is really a macro expansion. Last edited by ocicat : 11-Dec-2008 at 00:55.
|
|
#3
|
|||
|
|||
Re: Definition of a Macro c++Thanks, ok OCICAT i hope you really can provide some help here. i am just done with my class data structure I so i am taking dat structure II than no more programming classes.
I am trying to get familiar more with c++ comilers and built in classes so these are my questions : ( knowing that i am using visual studio express edition 2008). 1- how to get more information about the c++ language (like macros...) 2- i want to know how the class integer is defined and by that i mean (private members, public members) thanks all, OCICAT and DAVE (special thanks) |
|
#4
|
|||
|
|||
Re: Definition of a Macro c++Quote:
One of the better online resources is http://www.cplusplus.com/, however a better choice would be to get one of the better textbooks, & read it cover-to- cover. The best, in my opinion, is Stroustrup: http://www.amazon.com/C-Programming-...14123&sr= 8-1 ...but be advised that this book is meant for people who have some programming background. Likewise, I don't know if it has been translated into your native language. That is for you to determine. Lastly, as I mentioned before, macros are not as important in C++. In fact, there is little reason to use them at all. If you are really interested in learning C++, you may be better served by learning more of where it came from. The best book on C is Kernighan & Ritchie: http://www.amazon.com/Programming-La...14640&sr= 8-1 Chances are, this book may have been translated into your native language. Quote:
http://www.amazon.com/Compilers-Prin...9014370&sr=1-1 |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to initialize an array in a class definition or in constructor? | pablowablo | C++ Forum | 17 | 05-Sep-2009 13:14 |
| Macro problem with Assembly language | Widgets | Assembly Language | 5 | 11-Nov-2007 13:30 |
| Dynamic definition? | yuide | MS Visual C++ / MFC Forum | 1 | 15-Apr-2006 12:56 |
| SWAP macro | alcoholic | C Programming Language | 4 | 15-Jan-2006 18:39 |
| Macro Scripting in Power Point | alcedo | Computer Software Forum - Windows | 0 | 27-Aug-2005 02:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The