User Tools

Site Tools


notes:cprog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
notes:cprog [2018/11/16 02:50] – [Other] sdiarranotes:cprog [2018/11/16 03:14] – [Notes] sdiarra
Line 80: Line 80:
 Although **typedef** appears to be defining only types, it removes some overheads down the road as a developer,it provides consistency, and clarity when used effectively. Although **typedef** appears to be defining only types, it removes some overheads down the road as a developer,it provides consistency, and clarity when used effectively.
  
 +-------
 +<color #ed1c24>**UNDEF**</color>
 +
 +Undef is a directive in that is available in C and C++. It as the form of #undef when called. Undef is used as a complement to the #define, as a preprocessor directive it is used to enclosed a #define statement to make sure there is no naming conflict and constrict one's logic within a set of code. Let's take a macro for example it is efficient for macros primarily because of the fact that it does common tasks such print, as many modules take have various print functions, the ideal way to make sure there is no conflict is to use undef. This is how it is used:
 +
 +<code>
 +    #define pprintf1() //for pretty-printf
 +    #undef pprintf1()
 +</code>
 +
 +easy peasy! 
 ======Other====== ======Other======
 ------- -------
notes/cprog.txt · Last modified: 2018/11/20 13:24 by sdiarra