2005-12-10から1日間の記事一覧

はじめての C

C programming note*1 次は、文字列の 後ろ側にある 空白を とり除く関数、void remove_pos_blank(char *buf) { char *q; if (*buf == '\0') return; q = buf + strlen(buf) - 2; /* minus 2 ('\n' + '\0') */ while (ISBLANK(*q)) --q; *(q + 1) = '\n'; *(…