ECS 30 Chapter Notes - Chapter 6: Null Character, Include Directive, C String Handling

55 views3 pages

Document Summary

Chapter 6 - applications with strings and text. A string constant is a sequence of characters or symbols between a pair of double-quote characters. Strings are held in memory by character codes as shown with the strings below. The ending of a string always has the special character \0 which is called a null character. This is a string terminator, and should not be confused with null. There is nothing stopping you from writing the null character, but once it is reached the string will be stopped. There are no specific variables that hold strings so a simple way of storing a variable string is through a char array. You must always add one to your size to allow for the string terminator. You can initialize the variable char without size and c will give it the appropriate size. If you give more space than required, it will initialize the elements, give a the null character.

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

Related Questions