macro definitions in c ++ for recycled use simplified

Man of few words said, the method

#define _for(i,a,b) for( int i=(a); i<(b); ++i)
#define _rep(i,a,b) for( int i=(a); i<=(b); ++i)

This simple macro definition greatly simplified for use in the examples

 

_for(i, 0, 4) 
{
    printf("%d", i);
}

look for more concise, and use other methods with the average for like.

Guess you like

Origin www.cnblogs.com/YY666/p/10994986.html