Program Preprocessor variable postfix , C/C++ Programming

Run the following C++ program with and without preprocessor variable POSTFIX defined.

#include

using namespace std;

extern "C" int atoi( const char *str );

struct Node {

int i, j, k;

Node() {}

};

int main( int argc, char *argv[ ] ) {

int times = 10000;

switch ( argc ) {

case 2:

times = atoi( argv[1] );

} // switch

vector v( 10000 );

vector::iterator vi;

volatile int j = 0; // ignore, prevent loop elimination

for ( int i = 0; i < times; i += 1 ) {

for ( vi = v.begin(); vi != v.end();

#ifdef POSTFIX

vi ++

#else

++ vi

#endif

) {

j += 1; // ignore, prevent loop elimination

}

}

}

Posted Date: 3/2/2013 2:13:54 AM | Location : United States







Related Discussions:- Program Preprocessor variable postfix , Assignment Help, Ask Question on Program Preprocessor variable postfix , Get Answer, Expert's Help, Program Preprocessor variable postfix Discussions

Write discussion on Program Preprocessor variable postfix
Your posts are moderated
Related Questions
color representation 0,1,2,3,4,5,6,7...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

wap to read an employee salary and calculate DA,HRA,pf,GROSS,NET conditions:- BASIC DA HRA PF >10000 7% 9% 10% & >20000 9% 11% 15% &


Hi, I need quick sort program without using recursion


Explain about the Floating point Constants in c language? A floating point constant is the number that contains either a fraction or decimal part. If an exponent is present its


write a javaprogram to solve padovan string using java? program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring;

1)      Factorial (for this question just provide an answer for each part)  1.1  Debug the following program to calculate N! #include using namespace std; main()