home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19097 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.7 KB  |  49 lines

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