Join Eduardo Corpeño for an in-depth discussion in this video String examination example, part of C Standard Library.
- [Instructor] All right, so let's illustrate…the string compare and strstr functions.…In this application, I have written a main function…in line seven that defines for strings.…They say strings in some programming language are easy.…And next I have a series of calls to a compare function…that will compare pairs of those strings,…and my compare function will print out…which of the strings is greater than the other…or less or if they are equal.…
That's why I made a function right there.…So our first task in line four is to write that function.…So our next task will be, as you can see in line 18,…we have a substring definition.…It's initialized as Java, and we will look…for that substring within one of those strings.…And so I'll write some code there so that…you can see strstr working.…Okay, so let's start with the compare function.…
I'll start writing codes in line five,…and it's as easy as calling the STRN Compare function…and analyzing its results.…So let me define an integer called cmp…that equals the result of STRN Compare.…
- Working with header files
- C constants and types
- Unformatted and formatted input/output
- Accessing files with C functions
- Generating random numbers
- Converting strings
- Sorting and searching for data
- Manipulating strings
- Using mathematical functions
Skill Level Intermediate
1. The C Standard Library
2. Input and Output Library: stdio.h
3. General Purpose: stdlib.h
4. String Functions: string.h
5. Mathematical Functions: math.h
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.