Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

C++ Preprocessors

There are many different usage for the C/C++ preprocessor, but first of all, heres a little background on what they are, and what theyre used for.

The preprocessor works as a script language for the C/C++ complier, for example there are a if command in the preprocessor for C/C++ and only if the condition is true the code within the if will be complied... So you see some of the usage area's now...
Someof the usage of the C/C++ preprocessor can be to make you code multiplatform, so the source code "change" after what platform is being complied on. :)

All of the C/C++ preprocessors start with a #.

The #include preprocessor.

Didn't think this was a preprocessor did'nt you?
Anyway this preprocessor works thte way that it include the file specified to the current source file, if the file that will be included exist in the same directry in a didrectory "neer" the file the " can be used insted of:

Syntax(defualt): #include
Syntax(local): #include "filename"
The #define, #undef preprocessor.

The #define preprocessor can be used as a variable. the "only" different is that a #define must be #undef before it can be re #define'd, it don't have to be asigned a value but then it will just "return" true, it can also be used to creath a "function", the thing that the #define really do is that it replace itseld with the code/value that's it been asigned in the source code.

Variable Syntax: #define name value
Function Syntax: #define function(variables) code
Syntax: #undef name

The #if,#else,#ifdef,#ifndef,#elif,#endif preprocessor
The #if preprocessor works almost like an normal if condition in the C/C++ language. If the condition is true then is complie the code inside the #if, the #else is to be placed before the #endif and it is just what it sounds if the first #if condition is'nt true then it complie the code inside the #else. O yeah, the #endif end the #if started. the #elif is a "else if" statement it works as an #if just that it must be placed inside a #if and only become "tested" if the first #if is not true or if a #elif before is not true. The #ifdef works as a #if that only check if something is #define'd, just the ended with a #endif. The #ifndef works the opposite way as the #ifdef exapt that it must be ended with a #endif too.

Syntax: #if VARIABLE boolean VARIABLE
Syntax: #ifdef VARIABLE
Syntax: #ifndef VARIABLE
Syntax: #elif VARIABLE boolean VARIABLE
Syntax: #else
Syntax: #endif

 
     
   
C++ Tutorial
 
  Introduction to C++
Introduction to C++
  Variables in C++
Variables in C++
  if statement in C++
if statement in C++
  Looping in C++
Looping in C++
  break & continue statements
break & continue statements
  Switch Case Statement
Switch Case Statement
  C++ Functions
C++ Functions
  Pointers in C++
Pointers in C++
  Arrays in C++
Arrays in C++
  Strings in C++
Strings in C++
  Structures in C++
Structures in C++
  C++ File I/O
C++ File I/O
  Typecasting in C++
Typecasting in C++
  C++ Classes
C++ Classes
  Recursion in C++
Recursion in C++
  Inheritance in C++
Inheritance in C++
  Initilization Lists in C++
Initilization Lists in C++
  Enumerated Types in C++
Enumerated Types in C++
  Templates in C++
Templates in C++
  C++ Preprocessors
C++ Preprocessors
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download How To Build A Niche Site Empire Ebook How To Build A Niche Site Empire
   
Download  100 000  Worth of the Biggest Money Making Secrets Ever Revealed Ebook 100 000 Worth of the Biggest Money Making Secrets Ever Revealed
   
Download Java Learning Made Easy  Ebook Java Learning Made Easy
   
Download  The 6 Dirty Little Secrets They Don't Want You To Know About Network Marketing Ebook The 6 Dirty Little Secrets They Don't Want You To Know About Network Marketing
   
Download Pay Per Click Marketing Guide Ebook Pay Per Click Marketing Guide
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz