0

suppose I have:

#define special_for(X,Y) { register int i = 0; for (;i<X;i++) {Y} }

It is used in the following functions:

init_lineholder(int nlines)
{
special_for(nlines, lineptr[i] = (char *)malloc(MAXLEN); tmp++;)
}

AND

print_lines()
{
special_for(tmp, if (lineptr[(first+tmp-i)%tmp] == NULL) break; else
printf("%s\n", lineptr[(first+tmp-i)%tmp]) ; ) /* had to space bcuz of stupid smiley */
}


how do I rewrite the functions so I don't need to use the special_for macro?

Edited by Ineedhelpplz: stupid smiley

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jonsca
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.