home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17917 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.8 KB  |  45 lines

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