Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!ncar!mephisto!rutgers!netnews.upenn.edu!msuinfo!midway!news From: gft_robert@gsbacd.uchicago.edu Newsgroups: comp.sys.mac.programmer Subject: Two (2) weenie C questions... Message-ID: <1990Aug29.202759.293@midway.uchicago.edu> Date: 29 Aug 90 19:21:30 GMT Sender: news@midway.uchicago.edu (News Administrator) Organization: University of Chicago Graduate School of Business Lines: 31 ---------- I know Pascal well, and I thought I had a pretty good idea of C, but I'm getting a bit lost in what seem to fairly elementary questions involving C and the Mac ToolBox. 1) How does one determine if a key is down using KeyMap? It's simple in Pascal: an array of booleans, but in the C interfaces it's declared as typedef struct KeyMap { long Key[4]; }KeyMap; which is considerably less obvious. 2) How does one return a Str255 from a function? THINK complains "can't return array from function"? But aren't I returning a pointer to the first (Oth) char of the Str255 if I "return myString"? Do I need Str255 *MyProc() if I want to pass back any reference to a Str255 at all? See, I told you these were weenie. And I'm supposed to learn C++? :-> Robert ============================================================================ = gft_robert@gsbacd.uchicago.edu * generic disclaimer: * "It's more fun to = = * all my opinions are * compute" = = * mine * -Kraftwerk = ============================================================================