the way to check if a character array is empty
Language/C 2012. 6. 13. 18:33char text[50];
if(strlen(text) == 0) {}
if(text[0] == '\0') {}
memset(text, 0, sizeof(text));
if(strlen(text) == 0) {}
text[0] == 0;
'Language > C' 카테고리의 다른 글
가변인수 va_start() (0) | 2012.06.11 |
---|---|
typedef & struct (2) (0) | 2012.05.29 |
sscanf (0) | 2012.05.29 |
typedef & struct (1) (0) | 2012.05.23 |
inconv source (iconv_open, iconv, iconv_close) (0) | 2012.05.16 |