(no subject)

Date: 2009-12-28 04:43 pm (UTC)
From: [identity profile] lightning-rose.livejournal.com

Pascal as a professional programming tool was pretty much dead by the mid 80's, although Wirth's book on algorithms and data structures was probably still in use and had a Pascal style syntax for the examples. Anyone with a reasonable knowledge of C could pick up Pascal in a couple of days.

What I was alluding to is that in Pascal, one defines the size of an array by the valid indices for that array. For example,

someString: array [0..99] of char;

defines a C style array of 100 bytes, indexed from 0 to 99

But to get a bit weird...

fooArray: array [-100..100] of foo;

defines an array of type foo containing 201 elements that can be indexed from -100 to 100. And yes, any arbitrary values such as 17..77 can be used.

This maybe useful for some programming problems, but I've never needed anything like it.

Profile

maradydd: (Default)
maradydd

September 2010

S M T W T F S
   1234
567891011
12131415 161718
19202122232425
26 27282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags