CIS 1500 Chapter Notes - Chapter 5: C String Handling, Null Character

41 views1 pages

Document Summary

Case matters when comparing strings (apples =/= apples) When you compare strcmp compares ascii values in the letters. Can use < , > , == to compare the strings. Each string has a position number called an index. The notation stringname[0] has access particular location in an index. So that code knows where a string ends the compiler adds a null character at the end of a string. Strlen outputs the length of a string. Usertext[strlen(usertext) - 1] will return the last character in a string. #include provides accesses functions to use on characters isalpha: true if alphabetical isdigit: true if digit 0-9 isspace: true if whitespace toupper: makes character uppercase tolower: makes character lowercase. An array stores multiple variables under one name. Some languages use a similar thing called a vector. Each item in an array is called an element.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents