Add tags

Add tags to the following comment
組み込みではないので自作で破壊的関数。
空白文字の判定は isspace を使っていますが、取り除かれる文字は ASCIIコードで [9, 10, 11, 12, 13, 32]。
1
2
3
4
5
6
7
8
9
#include <ctype.h>
char* rtrim( char *str ){
   char *p = str;
   while( *p++ );
   p--;
   while( isspace( *(--p) ) );
   *(p+1) = '\0';
   return str;
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...