Hello.,
I'm very new in C++, and I have a task to solve.
I have a function:
void cio_display(const char *str, int row, int col, int len){
int i;
cio_move(row, col);
if(len<=0) {
cio_putstr(str);
}
else{
for(i=0;i<len && str[i];i++)
cio_putch(str[i]);
for(;i<len;i++)
cio_putch(' ');
}
here iss what i have done:
void cio_display(const char *str, int row, int col, int len){
int i;
cio_move(row, col);
for( i = 0; ((len <= 0) && cio_putstr(str)), (i < len && str[i]); i++){
cio_putch(str[i]);
}
for(;i<len;i++)
cio_putch(' ');
}
The problem id the function cio_putstr() returns void, thats why lazy evaluation is not possible. Any other thoughts would be greatly appreciated!
Thank you