CSE 303 Wi08 midtermKey

CSE 303 Wi08 midtermKey - CSE 303 Winter 2008 Midterm Key...

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

View Full Document Right Arrow Icon
CSE 303 – Winter 2008 Midterm Key 1. [2 points] Give a Unix command line that will list all (and only) files that end with ‘.h’ in the current working directory. Full credit: ls *.h Extra credit: ls –a *.h (although this actually doesn’t help find a file with name like .a.h) 2. [2 points] Support the claim that the shell’s command line interface is strictly more powerful than a double-click-to-launch interface (e.g., the Windows desktop). Give a significant category of things you can do with the former that you cannot do (at least not even close to easily) with the latter. Any of a number of things: can easily specify arguments and switches; can pipe output of one into another; can use history. 3. [4 points] Suppose you’re designing an application you intend to be run by users of Unix shell interfaces, and you’re interested in allowing those users to customize individual runs of your program. One way you could support that is by implementing some set of command line switches; the user could specify the switches each time the program is used to change its default behavior. Name two other ways you could implement that would allow users to customize each invocation. 1. environment variable settings 2. read settings in a startup file (e.g., emacs reads ~/.emacs) 4. [3 points] What is the purpose of .h files in C programs? Be specific. (For example, what function do they have at compile, link, and run times?) Compile time: allow type-checking of the code in the .c file Link time: no function Run time: no function 5. [2 points] Suppose my current working directory has (only) these files in it: addOne addTwo addAll deleteOne deleteTwo deleteAll All are executable. What could I type to launch
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 10/12/2009 for the course CSE 303 taught by Professor Perkins during the Winter '08 term at University of Washington.

Page1 / 5

CSE 303 Wi08 midtermKey - CSE 303 Winter 2008 Midterm Key...

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