1402 15 - 3/7/2010 1 COMP 1002/1402 Introduction to Systems...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3/7/2010 1 COMP 1002/1402 Introduction to Systems Programming Chapter 15: Strings Notes Adapted from Dr. J. Morrison, Dr D. Nussbaum Strings Strings are sequences of characters So frequently used that char is not enough C offers a little more than char Mainly literals & functions 2 COMP1002/1402 - Chapter 14: Strings 3/7/2010 2 Strings : 2 Classes, 3 Types 3 COMP1002/1402 - Chapter 14: Strings Two Classes, Three Types String : Fixed length length known in advance Variable length may change at runtime Length controlled length stored Delimited end of string is delimiter 4 COMP1002/1402 - Chapter 14: Strings 3/7/2010 3 Examples : String Types 5 COMP1002/1402 - Chapter 14: Strings Storing Strings in C Strings are Strings are: 1. Stored in array of chars 2 Terminated with '\0' 2. Terminated with '\0' 6 COMP1002/1402 - Chapter 14: Strings 3/7/2010 4 Storage : byte wise Therefore Every char needs byte Every string requires one extra byte 7 COMP1002/1402 - Chapter 14: Strings Strings and char...
View Full Document

Page1 / 12

1402 15 - 3/7/2010 1 COMP 1002/1402 Introduction to Systems...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online