home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!gatech!rpi!newsserver.pixel.kodak.com!laidbak!katzung
- From: katzung@i88.isc.com (Brian Katzung)
- Subject: Re: Moving from Pascal to C, Help please!!!!!!
- Message-ID: <1992Dec31.211801.16730@i88.isc.com>
- Sender: usenet@i88.isc.com (Usenet News)
- Nntp-Posting-Host: laitnite.i88.isc.com
- Organization: Interactive Systems Corporation, Naperville, IL
- References: <78858@hydra.gatech.EDU>
- Date: Thu, 31 Dec 1992 21:18:01 GMT
- Lines: 36
-
- In article <78858@hydra.gatech.EDU> gt6758b@prism.gatech.EDU (Michael Maverick Kopack) writes:
- |There are a lot of things about C that I find very frustrating after comming
- |from a decent course in Pascal. For one is the way that Arrays are handled.
- |I like being able to do stuff like array [6..26] of int whereas in C you
- |get forced into calling the indeces 0-19 [sic].
-
- Try:
-
- #define ARRAYLOWER 6
- #define ARRAYUPPER 26
- int _array[ARRAYUPPER - ARRAYLOWER + 1];
- #define array (&_array[-ARRAYLOWER])
-
- |I can't imbed functions so other procedures can't see them (scoping rules),
-
- Yes, this is true. Function scope may only be restricted to the source
- module level.
-
- |I have to use global variables a lot (taught as a no-no at GT)
-
- Off hand, I can't imagine why you would need any in C that you wouldn't
- use in Pascal. Do you have specific examples showing where you feel you
- need them in C but not in Pascal?
-
- |seems like C is TOO flexible! How do you guys get anything done when there are
- |about 500 different ways to do it?
-
- I try to pick a way that I feel is easy to read, understand, and maintain.
-
- |Please, open my mind to C!
-
- You'll have to open your own mind. I gave the last of my drugs to a
- previous poster. :-)
-
- -- Brian Katzung katzung@i88.isc.com
-
-