Lecture 27: String Functions Continued
Monday, May 7, 2012
[Up]
[Previous Lecture]
[Next Lecture]
Reading Assigned: None
Homework Due: None
Homework Assigned: Classwork 15 -- from last class
Classwork Assigned: None
Topics Covered:
- Quiz 5 today study guide
- String functions continued
- The C standard library has many functions to operate on strings
- You can also look online
- Functions we already went over
- strcpy - make a copy of a string
- strncpy - make a copy of a string (safe version, limits size) example
- strcat - concatanate (append) a string to another string example
- strlen - find the length of a string (0 = no characters, 1 = 1 character, etc.)
- Some more interesting functions we will cover today
- strchr - find a character in another string
- How would we use the return value of strchr?
- strstr - find a string in another string
- How would we use the return value of strstr?
- strtok - a string tokenizer (break a string into pieces based on tokens)
- How does strtok work?