Skip to content

Instantly share code, notes, and snippets.

@hymkor
Last active March 10, 2017 08:40
Show Gist options
  • Save hymkor/5e6a4dd8212d61ce3d4c2c94f46642ed to your computer and use it in GitHub Desktop.
Save hymkor/5e6a4dd8212d61ce3d4c2c94f46642ed to your computer and use it in GitHub Desktop.
strlen の戻り値は size_t (unsigned)
$ cat foo.c
#include <stdio.h>
#include <string.h>
int main()
{
int zero=0;
puts( zero > strlen("")-1 ? "true" : "false");
return 0;
}
$ ./a.out
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment