String Operations Flashcards
length of s
strlen(s)
copy ct to s
strcpy(s,ct)
concatenate ct after s
strcat(s,ct)
compare cs to ct
strcmp(cs,ct)
only first n chars
strncmp(cs,ct,n)
pointer to first c in cs
strchr(cs,c)
pointer to last c in cs
strrchr(cs,c)
copy n chars from ct to s
memcpy(s,ct,n)
copy n chars from ct to s (may overlap)
memmove(s,ct,n)
compare n chars of cs with ct
memcmp(cs,ct,n)
pointer to first c in first n chars of cs
memchr(cs,c,n)
put c into first n chars of s
memset(s,c,n)
reversed
strlen(s)
length of s
reversed
strcpy(s,ct)
copy ct to s
reversed
strcat(s,ct)
concatenate ct after s
reversed
strcmp(cs,ct)
compare cs to ct
reversed
strncmp(cs,ct,n)
only first n chars
reversed
strchr(cs,c)
pointer to first c in cs
reversed
strrchr(cs,c)
pointer to last c in cs
reversed
memcpy(s,ct,n)
copy n chars from ct to s
reversed
memmove(s,ct,n)
copy n chars from ct to s (may overlap)
reversed
memcmp(cs,ct,n)
compare n chars of cs with ct
reversed
memchr(cs,c,n)
pointer to first c in first n chars of cs
reversed
memset(s,c,n)
put c into first n chars of s