Creative Hermione

prefectmarcus at yahoo.com prefectmarcus at yahoo.com
Mon Aug 20 06:32:36 UTC 2001


No: HPFGUIDX 24542

--- In HPforGrownups at y..., Alfredo Ramirez <bonds0097 at y...> wrote:
> When you're learning to program, upon looking up a command, you 
might
> see something like this:
> 
> Printf function:
> 
> Printf("expression")
> 

Yes, and what happens when someone sees this:

scanf function:

scanf("expression",...);


and then writes:
/**********************************/
void f(void)
{
 char *str;

 scanf( "%s\n",str);  // str is not initialized!!!!
}

/***********************************/
(For non-geeks, the computer would end up sticking a bunch a 
characters into a random place.  It could be anywhere.  It could be 
somewhere harmless.  It could be into the code that launches the 
missle!)


Let's not forget Wizard Baruffio.  :)

"Perilous to us all are the devices of an art deeper than we possess 
ourselves."  (JRR Tolkein - The Two Towers - Chapter 11:The Palantir)

Marcus







More information about the HPforGrownups archive