ENG 1002 Lecture Notes - Lecture 7: Dynamic Array, Null Character, C String Handling

31 views7 pages

Document Summary

Topic 10: input/output streams, string functions, static and dynamic arrays. This lecture covers some useful string functions. Some of these functions include: strlen() -for finding the length of a string, strcpy() -for copying one string to another, strcat() -for concatenating two strings, strcmp() -for comparing two strings. These are some of the most common string functions used in c. - we can access them by putting: #include at the top of our c program. The strlen() function measures the length of a string up to -but not including the null character at the end of its parameter: The strcpy() function copies from one string array to another. Strings can be joined together by the strcat() operation. Strcmp(str1, str2) compares str1 and str2 returns; Less than zero if str1 is lexicographically less than str2. Exactly zero if str1 is exactly equal to str2. Greater than zero if str1 is lexicographically greater than str2. Fixed length versions of the operations above.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions