@wywm@z[y[W
ŏIXVF2024N1011
@Cł́AJavaScriptCPythonƂ͈āA2̕string1Cstring2ƂAstring1 = string2; ƂĂAstring2̓estring1ɓ܂Bstring2̃AhXstring1ɓ邾łBif (string1 == string2)ƂĂAstring1string2̕ƂĂ̔r͍sꂸAAhXr邾łBCł͊gāAƂĂ̑(strcpy())Ar(strcmp())s܂B
@C̕ȉɌf܂B
double atof(char *string)
@string̐lɂł镶ł͈͂double^ɕϊ܂B<sydlib.h>includeĂB
int atoi(char *string)
@string̐lɂł镶ł͈͂int^ɕϊ܂B<sydlib.h>includeĂB
long atol(char *string)
@string̐lɂł镶ł͈͂long^ɕϊ܂B<sydlib.h>includeĂB
int isalnum(int c)
@cp܂͐̏ꍇ0ȊOApłłȂꍇ0Ԃ܂B<ctype.h>includeĂB
int isalpha(int c)
@cp̏ꍇ0ȊOApłȂꍇ0Ԃ܂B<ctype.h>includeĂB
int isascii(int c)
@c̃R[h16i007f̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isblank(int c)
@c(16iŕR[h20)̏ꍇ0ȊOAłȂꍇ0Ԃ܂B<ctype.h>includeĂB
int iscntrl(int c)
@c̃R[h16i001fC܂7f̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isdigit(int c)
@c'0'`'9'̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isgraph(int c)
@c̃R[h16i217ȅꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int islower(int c)
@c̃At@xbg'a'`'z'̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isprint(int c)
@c̃R[h16i207ȅꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int ispunct(int c)
@c蕶(R[h16i21`2fC3a`40C5b`60C7b`7e)̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isspace(int c)
@c(R[h16i09`0dC20)̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isupper(int c)
@c啶̃At@xbg'A'`'Z'̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int isxdigit(int c)
@c16i\(R[h16i30`39C41`46C61`66)̏ꍇ0ȊOAȊȌꍇ0Ԃ܂B<ctype.h>includeĂB
int mblen(char *string, size_t n)
@LOCALELC_CTYPEAja_JP.SJIS(CYGWINlocaleR}hŊmFł܂)ɂȂĂAshift-JIŜ悤1oCg̔pC2oCg̑Sp݂镶̃oCgPʂ̒Ԃ܂Bn͍ő啶łB<stdlib.h>includeĂB
void *memchr(void *buffer, int c, size_t count)
@buffercountoCg͈̔͂ŁA1oCg̃f[^c oĂÃAhXԂ܂Bf[^coĂȂANULLԂ܂Bbuffer̎w͕łKv͂܂Bint^łAfloat^łA\̂łOKłB<string.h>includeĂB
int memcmp(void *buf1, void *buf2, size_t count)
@buf1buf2̐擪countoCg͈̔͂Ŕr܂Bbuf1 = buf2Ȃ0Abuf1 > buf2Ȃ琳Abuf1 < buf2Ȃ畉Ԃ܂Bbuf1Cbuf2̎w͕łKv͂܂Bint^łAfloat^łA\̂łOKłB<string.h>includeĂB
void *memcpy(void *buf1, void *buf2, size_t count)
@buf2buf1countoCgRs[܂Bbuf1ȍ~buf2ȍ~ŏdȂ肪ꍇ͕̓ۏ܂Bbuf1Ԃ܂Bbuffer̎w͕łKv͂܂Bint^łAfloat^łA\̂łOKłB<string.h>includeĂB
void *memmove(void *buf1, void *buf2, size_t count)
@buf2buf1countoCgRs[܂Bbuf1ȍ~buf2ȍ~ŏdȂ肪ꍇ͕ۏ܂Bbuf1Ԃ܂Bbuffer̎w͕łKv͂܂Bint^łAfloat^łA\̂łOKłB<string.h>includeĂB
void *memset(void *buffer, int c, size_t count)
@buffercountoCg1oCg̃f[^cŖ߂܂BbufferԂ܂Bbuffer̎w͕łKv͂܂Bint^łAfloat^łA\̂łOKłB<string.h>includeĂB
int strcasecmp(char *str1, char *str2)
@str1ƕstr2啶̈ႢĔr܂Bv0Cstr1̕R[hstr2̕R[h傫ΐCΕԂ܂B<string.h>includeĂB
char *strcat(char *str1, char *str2)
@str1̌ɕstr2A܂BAstr2̐擪str10ɏdȂ悤ɕRs[܂B҂ɏdȂ肪ꍇ͕̓ۏ܂Bstr1ɂ͏[ȑ傫̗̈悪KvłBstr1Ԃ܂B<string.h>includeĂB
char *strchr(char *string, int c)
@stringōŏɕcoĂAhXԂ܂BstringɕcoĂȂƂNULLԂ܂B<string.h>includeĂB
int strcmp(char *str1, char *str2)
@str1ƕstr2r܂Bv0Cstr1̕R[hstr2̕R[h傫ΐCΕԂ܂B<string.h>includeĂB
char *strcpy(char *str1, char *str2)
@str2̓estr1ȍ~ɃRs[Astr1Ԃ܂Bstr1ɂ͏[ȗ̈悪KvłBstr1ȍ~str2ȍ~ɏdȂ肪ꍇ͕̓ۏ܂B<string.h>includeĂB
size_t strcspn(char *string, char *target)
@string̒ŁAtargetɑ݂镶TAŏɌʒu܂ł̕Ԃ܂Bstring = "abcdefg"; target = "egh"; łAŏ'e'܂"abcd"4̂ŁA4Ԃ܂B<string.h>includeĂB
char *strerror(int errno)
@G[ԍerrnoɑΉG[EbZ[Ww|C^Ԃ܂BerrnóA<errno.h>AstrerroŕA<string.h>includeĂB
size_t strlen(char *string)
@string̒(0͊܂߂Ȃ)Ԃ܂B<string.h>includeĂB
int strncasecmp(char *str1, char *str2, size_t count)
@str1Cstr2̍ŏcount啶̈ႢĔr܂Bv0Cstr1̕R[hstr2̕R[h傫ΐCΕԂ܂B<string.h>includeĂB
char *strncat(char *str1, char *str2, size_t count)
@str1̌ɕstr2̂͂߂őcountA܂BAstr2̐擪str10ɏdȂ悤ɕRs[܂B҂ɏdȂ肪ꍇ͕̓ۏ܂Bstr1ɂ͏[ȑ傫̗̈悪KvłBstr1Ԃ܂B<string.h>includeĂB
int strncmp(char *str1, char *str2, size_t count)
@str1ƕstr2ŏcount͈̔͂Ŕr܂Bv0Cstr1̕R[hstr2̕R[h傫ΐCΕԂ܂B<string.h>includeĂB
char *strncpy(char *str1, char *str2, size_t count)
@str2̍ŏcountstr1ȍ~ɃRs[Astr1Ԃ܂Bstr1ɂ͏[ȗ̈悪KvłBstr1ȍ~str2ȍ~ɏdȂ肪ꍇ͕̓ۏ܂B<string.h>includeĂB
char *strpbrk(char *string, char *target)
@string̒ŁAtargetɑ݂镶TAŏɌʒuԂ܂Bstring = "abcdefg"; target = "egh"; łAŏ'e'ʒuAstring + 4Ԃ܂B<string.h>includeĂB
char *strrchr(char *string, int c)
@stringōŌɕcoĂAhXԂ܂BstringɕcoĂȂƂNULLԂ܂B<string.h>includeĂB
size_t strspn(char *str1, char *str2)
@string̐擪Atarget̕łłĂ镔̍ő̒Ԃ܂Bstring = "abcdefg"; target = "abh"; łAŏ'c'܂"ab"2̂ŁA2Ԃ܂B<string.h>includeĂB
char *strstr(char *str1, char *str2)
@str1̐擪Astr2oŏ̈ʒuw|C^Ԃ܂Bstr2݂ȂꍇANULLԂ܂B<string.h>includeĂB
double strtod(char *string, char **ep)
@string̍ŏ琔lϊłȂoĂ܂ł̐̕ɂāAdouble^ɕϊĕԂ܂BlϊłȂoĂʒuw|C^ep̎w|C^ϐɕԂ܂(ep͕^w|C^w|C^Ȃ̂ŁAchar **epƂȂ܂)B<stdlib.h>includeĂB
float strtof(char *string, char **ep)
@string̍ŏ琔lϊłȂoĂ܂ł̐̕ɂāAfloat^ɕϊĕԂ܂BlϊłȂoĂʒuw|C^ep̎w|C^ϐɕԂ܂(ep͕^w|C^w|C^Ȃ̂ŁAchar **epƂȂ܂)B<stdlib.h>includeĂB
char *strtok(char *string, char *delimiter)
@stringdelimiter̒ɑ݂镶ŕ܂Bstring̒ɕ݂ꍇA2ڈȍ~́AstringNULLƂāAstrtok()ĂяoƁAȌIʒu̎當delimiter̒̕T܂Bdelimiter̒ɑ݂镶ɂoꂽŏ̐̕擪AhXԂ܂BT镶ȂȂNULLԂ܂B<string.h>includeĂB
@delimiter = " ,."(ƃJ}ƃsIh)̂ƂAstrtok()ȉ̂悤ɂĎg܂B
char *string, *delimiter;
char *pc1;
char *token[100];
int token_count = 0;
char strx[] = "abc,defg hij.klmn";
ƒ`ĂƂāA
string = (char *)malloc(100);
strcpy(string, strx);
delimiter = " ,.";
while(pc1 = strtok(string, delimiter)) {
token[token_count++] = pc1;
if (token_count > 99) break;
string = NULL;
}
free(string);
IƁAtoken[0]"abc"Ctoken[1]"defg"Ctoken[2]"hij"Ctoken[3]"klmn"ƂȂAtoken_count4ɂȂĂ܂BLŁAstringmalloc()gė̈mۂĂ邱ƂɒӂĂBstrtok()̒ŁAstring̎ẅɁA蕪ꂽ0߂悤ɂĂKv܂B
long strtol(char *string, char **ep, int base)
@string̍ŏ琔lϊłȂoĂ܂ł̐̕ɂāAlong^ɕϊĕԂ܂BlϊłȂoĂʒuw|C^ep̎w|C^ϐɕԂ܂(ep͕^w|C^w|C^Ȃ̂ŁAchar **epƂȂ܂)B<stdlib.h>includeĂB
int tolower(int c)
@p啶cɕϊĕԂ܂BϊłȂꍇcԂ܂B<ctype.h>includeĂB
int toupper(int c)
@pc啶ɕϊĕԂ܂BϊłȂꍇcԂ܂B<ctype.h>includeĂB
yLz@LłB̊F܂̂x肽A낵肢܂B
yLz@L͂܂łłB