* better
[mascara-docs.git] / lang / C / the.ansi.c.programming.language / c.programming.notes / homework / PS7.html
blob5b79c3b897f632f9b890fb9012b8db616c5b1707
1 <!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
2 <!-- This collection of hypertext pages is Copyright 1995-7 by Steve Summit. -->
3 <!-- This material may be freely redistributed and used -->
4 <!-- but may not be republished or sold without permission. -->
5 <html>
6 <head>
7 <link rev="owner" href="mailto:scs@eskimo.com">
8 <link rev="made" href="mailto:scs@eskimo.com">
9 <title>Assignment #7</title>
10 </head>
11 <body>
12 <H1>Assignment #7</H1>
18 <B>Introductory C Programming
19 <br>
20 <br>
21 UW Experimental College
22 </B><br>
23 <br>
24 <B>Assignment #7
25 </B><p><B>Handouts:
26 </B></p><p><a href="PS7.html">Assignment #7</a>
27 <br><a href="PS6a.html">Assignment #6 Answers</a>
28 <br><a href="http://www.eskimo.com/~scs/cclass/notes/sx14.html">Class Notes, Chapter 14</a>
29 <p><B>Reading Assignment:
30 </B></p><p><a href="http://www.eskimo.com/~scs/cclass/notes/sx12.html">Class Notes, Chapters 12</a>
31 <a href="http://www.eskimo.com/~scs/cclass/notes/sx13.html">and 13</a>
32 <p><B>Review Questions:
33 </B></p><OL><li>What do we mean by the ``equivalence between arrays and pointers''
34 in C?
35 <li>If <TT>p</TT> is a pointer, what does <TT>p[i]</TT> mean?
36 <li>Can you think of a few reasons why an I/O scheme which did not
37 make you open a file and keep track of a ``file pointer,'' but instead
38 let you just mention the name of the file as you were reading
39 or writing it, might not work as well?
40 <li>If <TT>argc</TT> is 2, what is <TT>argv[1]</TT>? What if <TT>argc</TT> is 1?
41 </OL><br>
42 <br>
43 <p><B>Exercises:
44 </B></p><OL><li>Rewrite the <TT>replace</TT> function from last week to remove the restriction
45 that the replacement substring have the same size. Be sure to
46 test it on replacement strings which are larger, smaller, and
47 the same size. Should it work if the replacement string is the
48 empty string?
49 <li>Rewrite the pattern matching program
50 (Assignment 6, Exercise 1)
51 to prompt the user for the name of the file to search in and
52 a pattern to search for.
53 <li>Rewrite the pattern matching program
54 (Assignment 6, Exercise 1)
55 to accept the pattern and file name from the command line
56 (like the Unix <TT>grep</TT> or MS-DOS <TT>find</TT> command).
57 </OL><hr>
58 <hr>
59 <p>
60 This page by <a href="http://www.eskimo.com/~scs/">Steve Summit</a>
61 // <a href="copyright.html">Copyright</a> 1995-9
62 // <a href="mailto:scs@eskimo.com">mail feedback</a>
63 </p>
64 </body>
65 </html>