Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ptsfa!ihnp4!cuae2!ltuxa!ll1a!ll1!nesac2!jec From: jec@nesac2.UUCP Newsgroups: comp.lang.c Subject: Re: C Beginner Message-ID: <1244@nesac2.UUCP> Date: Sat, 13-Jun-87 21:39:12 EDT Article-I.D.: nesac2.1244 Posted: Sat Jun 13 21:39:12 1987 Date-Received: Sun, 14-Jun-87 21:39:55 EDT References: <7808@brl-adm.ARPA> Organization: NESAC Lisle, Illinois Lines: 52 I'm posting a reply, since the mailer barfed. > And my last question is, does anyone have ideas for little'do nothing' > programs that I can tackle as challenges to force me to learn the > language? I have a fairly large project in mind for the future, but > trying it now would be extremely frustrating and a waste of time, I am > sure. A programming project for a (slightly more than) C beginner. Given - a 250K file of Pascal functions, each of which is preceeded by a one line comment of the form below. { FunctionName - description } ^ ^ One space at each end of comment, comment starts at left margin, most names start with an uppercase letter, and may be composed of almost any combination of upper and lower case letters. Other (internal) comments may start at the left margin, but will begin with "{'" (single quote) or "{ " (two spaces) Requirement - create a program to take the source file name from the command line, and do the following: Read the source file, recognizing the { Name } construct, ignoring any comments that are of the form {'anything'} or of the form { anything } (two spaces after '{'), and ignoring comments that do not start at the left margin. Create a file of the same name as the function name, but limited to eight characters, and with the extension of ".pas". Recognize if two functions have the same name, and change the second name to avoid overwriting the previous name. Stop after 'maximum directory entries -1' files and prompt for the destination disk to be replaced with another blank disk. If using disks with less than 360K space, also check for amount of space used on the disk and prompt if another disk is needed. This check can be made without accessing the DOS functions to read the file size from the directory. My version works on an MSDOS machine, write yours for your machine. If you want a copy of my version (hardcopy) write me at the address that news SHOULD include below. This is a real task that I had to do this week, since the available editor on the PC couldn't handle a 250K+ file. Have fun -- John Carter AT&T Communications - Atlanta RWC USnail: 3001 Cobb Parkway, Atlanta GA 30339 E-mail: ...ihnp4!cuea2!ltuxa!ll1!nesac2!jec Voice: 404+951-4642 (The above views are my very own. How dare you question them? :-)