home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 13954 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  1.8 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!scasterg
  2. From: scasterg@magnus.acs.ohio-state.edu (Stuart M Castergine)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Newsbie needs help. Getting data out of buffPtr
  5. Summary: pointers types conversions buffers confusion
  6. Message-ID: <1992Aug13.191502.10443@magnus.acs.ohio-state.edu>
  7. Date: 13 Aug 92 19:15:02 GMT
  8. Sender: news@magnus.acs.ohio-state.edu
  9. Organization: The Ohio State University
  10. Lines: 32
  11. Nntp-Posting-Host: bottom.magnus.acs.ohio-state.edu
  12.  
  13.  
  14. I'm very new at both C and Macintosh programming, so bear with me. My
  15. first project is a Hypercard XFCN. Very simple to start with.
  16.  
  17. 1. Path to a file is passed in as a parameter
  18. 2. Open File
  19. 3. Read some data from file.
  20. 4. Do some stuff with the data.
  21. 5. Write data to an output file.
  22. 6. Pass back the pathname of the output file to Hypercard.
  23.  
  24. Now, since I'm so new. Everything is difficult. I've got everything
  25. down up through step 3. the data is read in, it's in the buffer
  26. buffPtr (type Ptr).
  27.  
  28. My question is:
  29.  
  30. 1. How do I get the data out of buffPtr and into a string or array of
  31. char or whatever where I can look at it and work with it?  I'll
  32. essentially be breaking the data into different chunks, writing some
  33. to the output file, calculating numbers using some of the bits as lsb
  34. and msb of the numbers I want and writing them to the output file and
  35. repeating this for blocks of data read in from the input file until EOF.
  36.  
  37. I think I can handle the manipulation once I get the data somewhere
  38. where I know how to work with it, but I'm having trouble with the
  39. incompatible pointer types and other things I don't understand.
  40.  
  41. -- 
  42. scasterg@magnus.acs.ohio-state.edu -- Stuart M. Castergine
  43. Fiver: "Oh, Hazel, look! The field! It's covered with blood!"
  44. Hazel: "Don't be silly, it's only the light of the sunset." -- Watership Down
  45.