String Operations Flashcards
1
Q
length of s
A
strlen(s)
2
Q
copy ct to s
A
strcpy(s,ct)
3
Q
concatenate ct after s
A
strcat(s,ct)
4
Q
compare cs to ct
A
strcmp(cs,ct)
5
Q
only first n chars
A
strncmp(cs,ct,n)
6
Q
pointer to first c in cs
A
strchr(cs,c)
7
Q
pointer to last c in cs
A
strrchr(cs,c)
8
Q
copy n chars from ct to s
A
memcpy(s,ct,n)
9
Q
copy n chars from ct to s (may overlap)
A
memmove(s,ct,n)
10
Q
compare n chars of cs with ct
A
memcmp(cs,ct,n)
11
Q
pointer to first c in first n chars of cs
A
memchr(cs,c,n)
12
Q
put c into first n chars of s
A
memset(s,c,n)
13
Q
reversed
strlen(s)
A
length of s
14
Q
reversed
strcpy(s,ct)
A
copy ct to s
15
Q
reversed
strcat(s,ct)
A
concatenate ct after s