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
Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed

You have to write a subroutine (assembly language code using NASM) for the following equation.

it is a class enclosed in the scope of another class. For illustration: // Example: Nested class // class OuterClass { class NestedClass { // ... }; // .

Draw a flowchart for a program that allows the user to enter 20 names along with their ages and their Social Security Numbers in three parallel arrays. Programs shou

The files are meteorological radar data whose decompression is badly needed for relative study. Please contact Kathy Lee (Email: ; Cell phone: 0086 15701799056) or Mr. Zhu (Email:

What is  T y pe C a s t Op er a t o r :   T h e f l o a t c a n b e c o n v e r t e d t o i n t e g e r v a l u

DIFFERENCE BETWEEN WHILE AND DO WHILE LOOP?



(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digit