Pascal --> C question
Dave Jones
djones at megatest.UUCP
Wed Mar 16 08:54:48 AEST 1988
in article <2500 at charon.unm.edu>, cs2531ar at charon.unm.edu (Andrea Humenick) says:
>
> In article <4766 at sigi.Colorado.EDU> swarbric at tramp.Colorado.EDU (Frank Swarbrick) writes:
>>Or does the "packed" thing in Pascal have some special meaning? I never could
>>figure out what the difference between a packed array and a regular array was.
>
> I'm a new poster, so I'm sorry if this is improper.
>
> In my current pascal class my teacher explained packed and not packed as
> this
>
> packed: an array that can read in ' '
> not packed: an array that can only be read in character by character
>
> thank you.
I think you may have misunderstood your instructor. "Packed" does indeed
have special significance with regard to arrays of characters. Specificly,
a packed array of characters indexed beginning with 1 is called a "string",
and may be *written* all at one go, rather than a character at a time.
See "Standard Pascal User Reference Manual -- Doug Cooper", W. W.
Norton and Company, Inc. page 52.
You must have missed a whole bunch of recent postings about *reading* strings.
Standard Pascal does not support reading strings all at one go, perhaps
because the founding father couldn't make up his mind about how to handle
end-of-line conditions and short lines. Many Pascal implementations
do support reading strings, but don't count on it being portable.
Dave Jones
Megatest Corp.
880 Fox Lane
San Jose, CA.
95131
(408) 437-9700 Ext 3227
UUCP: ucbvax!sun!megatest!djones
ARPA: megatest!djones at riacs.ARPA
More information about the Comp.lang.c
mailing list