Lecture 21: More Arrays and Strings
Monday, April 16, 2012[Up] [Previous Lecture] [Next Lecture]
Reading Assigned: 8.1 - 8.3 and 9.1
Homework Due: None
Homework Assigned: Homework 10 - assigned last class
Classwork Assigned: Classwork 12
Topics Covered:
- Homework 10 questions?
- Reminder of array syntax
int x[10]; int i; for(i=0; i<10; i++) { x[i] = 100 + i; } for(i=0; i<10; i++) { printf("x[%d] is %d\n", i, x[i]); }
- Reminder of string syntax
char c[] = "hello"; printf("%s", c);
- An example program that we will build on
- This program will find the first instance of the specified character in a string
- Our classwork today will focus on modifying this program
- Any questions on how the program works?
- Classwork 12