Sunday, September 27, 2009

Modify io_display function

Challenge: Modify io_display function to the shortest code possible.

void io_display(const char *str, int row, int col, int len){
io_move(row, col);
(len <= 0) ? io_putstr(str) : for(int i=0; i < len; i++)
io_putch(i < strlen(str) ? str[i] : ' ');
}

No comments:

Post a Comment