String Operations Flashcards

1
Q

length of s

A

strlen(s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

copy ct to s

A

strcpy(s,ct)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

concatenate ct after s

A

strcat(s,ct)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

compare cs to ct

A

strcmp(cs,ct)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

only first n chars

A

strncmp(cs,ct,n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

pointer to first c in cs

A

strchr(cs,c)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

pointer to last c in cs

A

strrchr(cs,c)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

copy n chars from ct to s

A

memcpy(s,ct,n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

copy n chars from ct to s (may overlap)

A

memmove(s,ct,n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

compare n chars of cs with ct

A

memcmp(cs,ct,n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

pointer to first c in first n chars of cs

A

memchr(cs,c,n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

put c into first n chars of s

A

memset(s,c,n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

reversed

strlen(s)

A

length of s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

reversed

strcpy(s,ct)

A

copy ct to s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

reversed

strcat(s,ct)

A

concatenate ct after s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

reversed

strcmp(cs,ct)

A

compare cs to ct

17
Q

reversed

strncmp(cs,ct,n)

A

only first n chars

18
Q

reversed

strchr(cs,c)

A

pointer to first c in cs

19
Q

reversed

strrchr(cs,c)

A

pointer to last c in cs

20
Q

reversed

memcpy(s,ct,n)

A

copy n chars from ct to s

21
Q

reversed

memmove(s,ct,n)

A

copy n chars from ct to s (may overlap)

22
Q

reversed

memcmp(cs,ct,n)

A

compare n chars of cs with ct

23
Q

reversed

memchr(cs,c,n)

A

pointer to first c in first n chars of cs

24
Q

reversed

memset(s,c,n)

A

put c into first n chars of s