Qualified's blog

By Qualified, history, 4 years ago, In English

When I'm using:

#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = a; i >= b; i--)

how do I do

for(;;)

with the

rep(i, a, b)
per(i, a, b)
  • Vote: I like it
  • -20
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +53 Vote: I do not like it

Is simply writing for(;;) not shorter?

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it
per(i,1,i) will work.