Portability help

pathak at s.cs.uiuc.edu pathak at s.cs.uiuc.edu
Wed Feb 15 06:33:00 AEST 1989


Your professor seems to be assuming that the complier will initialize each
var in consecutive memory location. TC1.5 did that so:

printf("%s",&a); gave you 123456789.  However  the Unix machine didn't 
use consecutive memory locations so you got the kludge.

The reason Turbo gave you a 10a for an answer is that it read in your 
return key.  Why it did this is a mystery.  The Unix version worked 
correctly because it gave you a null which is the proper terminated of 
an input stream.

Heeren Pathak
s.cs.uiuc.edu
zaphod.ncsa.uiuc.edu



More information about the Comp.lang.c mailing list