home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
- From: walker@twix.unx.sas.com (Doug Walker)
- Subject: Re: How should I learn C?
- Originator: walker@twix.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <C01D36.BDC@unx.sas.com>
- Date: Tue, 29 Dec 1992 19:35:30 GMT
- References: <rlcarr.09er@animato.network23.com>
- Nntp-Posting-Host: twix.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 31
-
-
- In article <rlcarr.09er@animato.network23.com>, rlcarr@animato.network23.com (Rich Carreiro) writes:
- |> You now can use foo[6] to foo[26] to access the arrays. By extension you
- |> can even use negative subscripts (you can in theory -- I don't know off-hand
- |> if the language spec allows for it).
-
- The language does allow for it. However, I do not recommend that you
- use this technique - it's confusing. Do it the C way, don't try to
- coerce C into allowing you to do it the Pascal way.
-
- |> > I have to use global variables a lot (taught as a no-no at GT) and it just
- |>
- |> There's nothing in C that should make you use globals where you did not use
- |> them in Pascal. I don't understand this complaint.
-
- Probably the scoping problem - you can declare a "local" in a pascal
- procedure, and then use it in subprocedures. The answer is to use
- statics instead of globals, or to place all such variables in a
- structure and pass the structure to all subroutines.
-
- |> Rich Carreiro Home: (401)841-8514
-
- --
- *****
- =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
- *|. o.| || 1200/2400/9600 Dual
- | o |// For all you do, this bug's for you!
- ======
- usenet: walker@unx.sas.com bix: djwalker
- Any opinions expressed are mine, not those of SAS Institute, Inc.
-
-