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