🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2112

Re: First Project

#2112
From: Jens Schweikhardt
Date: Thu, 29 Feb 1996 14:37
33 lines
1762 bytes
In article <4h2ruj$hh@solutions.solon.com>,
Vincent Taijeron  <redleg1@foto.infi.net> wrote:
>I was wondering what would be a good "newbie" project.  What was one of 
>your first projects?  Looking for ideas.

Vincent,

My second program (after the canonical "hello, world\n" of course)
was writing a formatter similar to UNIX's pr. That's a filter program that
can add line numbers to listings, precede each page with a page header
and footer, break up long lines etc. I learnt a whole bunch of
basic techniques,

	- using argc, argv in option parsing with getopt
	- standard I/O with fgets, fprintf et al
	- dynamic memory (re)allocation to handle arbitrarily long lines
	- dealing with files of unlimited size
	- dealing with failures of various functions

That's quite a lot to start with. Looking back now, these techniques are in
almost any nontrivial program I write. I'd say some filter like pr makes
for a nice "newbie" project. Be sure to have your K&RII and manpages handy.

[Wow!  That's what I did.  I remember handing in a paper 2 days late, and
 explaining I needed to get my formatter debugged.  Mine did \bbold\B and
 \iitalic\I as well, at least, for the printer I owned. -mod]

Welcome to the C universe.

Bye, Jens

-- 
SIGSIG -- signature too long (core dumped)
Technical Details
Message-ID: <4h4dnr$8le@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4h2ruj$hh@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt)
Newsgroups: comp.lang.c.moderated
Subject: Re: First Project
Date: 29 Feb 1996 08:37:47 -0600
Organization: Comp.Center (RUS), U of Stuttgart, FRG
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4h4dnr$8le@solutions.solon.com>
References: <4h2ruj$hh@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com