AT&T 630 terminal - software ??

John Woods john at frog.UUCP
Fri Jan 20 18:02:00 AEST 1989


In article <9434 at ihlpb.ATT.COM>, gregg at ihlpb.ATT.COM (Wonderly) writes:
A> Besides, if you think that your AST/286 is so good, run the following
r> C program, if you get the output
e> 1
 > 70000
y> Your C compiler wins my award for effort otherwise you won't get any
o> words of sympathy from me...
u> main ()
 > {
s> 	unsigned long i;
u> 	char *s, *malloc();
r> 	s = malloc ((unsigned)70000);
e> 	for (i=0; i < ((unsigned)70000); i++)
?> 		s[i] = i;
 > 	printf ("%d\n%d\n", s[1], s[(unsigned)70000]);
 > }

Uh.............
A C compiler which can figure out from the printf usage that you actually
meant to (a) declare s as long *, and (b) malloc and initialize 70,001
longwords instead of 70,000 bytes is probably going to win more than awards...

I think you forgot the

#pragma Do What I Mean

line.
-- 
John Woods, Charles River Data Systems, Framingham MA, (508) 626-1101
...!decvax!frog!john, john at frog.UUCP, ...!mit-eddie!jfw, jfw at eddie.mit.edu

Presumably this means that it is vital to get the wrong answers quickly.
		Kernighan and Plauger, The Elements of Programming Style



More information about the Comp.unix.wizards mailing list