How can I combine two similar while loops in C?
I am going through K&R C and am currently trying to make my code for Exercise 1-22 more readable. I have two loops like so while (spaces != 0) { buf[pos]=’ ‘; ++pos; –spaces; } while (tabs != 0) { buf[pos]=’\t’; ++pos; –tabs; } spaces and tabs are integers which count preceding spaces and tabs… Read More How can I combine two similar while loops in C?