17 - ICS 103: Computer Programming in C Handout- 17 Topic:...

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

View Full Document Right Arrow Icon
ICS 103: Computer Programming in C Handout-17 Topic: Arrays of Strings & Use of break and continue statements. Objective: To know what is arrays of strings and how to use it. ? To know use of break and continue statements. Arrays of strings: To represent arrays of strings we need two-dimensional arrays . The first- dimension represents the number of strings in the array and the second- dimension represents the length of each string. Example: #define LEN1 5 #define LEN2 81 char strarray [ LEN1 ] [ LEN2 ] = {“This”, “is”, “ICS103”, “Course”, “LAB”} ; char str [LEN2] = {“Instructor”} ; Here the array strarray is an array of 5 strings with the size of each string being 81. Thus strarray [0] [0] = ‘T’, strarray [0] [1] = ‘h’, strarray [0] [2] = ‘i’, strarray [0] [3] = ‘s’, strarray[0][4] = ‘\0’; Similarly, strarray [4] [0] = ‘L’, strarray [4] [1] = ‘A’, strarray [4] [2] = ‘B’, strarray[4][3] = ‘\0’. The string arrays can be read
Background image of page 1

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

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

This note was uploaded on 05/09/2010 for the course ICS 102 taught by Professor Zaman during the Spring '10 term at Abilene Christian University.

Page1 / 7

17 - ICS 103: Computer Programming in C Handout- 17 Topic:...

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

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