Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!umd5!zben From: zben@umd5.umd.edu (Ben Cranston) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW C 3.0 question Summary: temps is ALREADY a pointer, &temps makes no sense... Message-ID: <6142@umd5.umd.edu> Date: 16 Feb 90 20:00:17 GMT References: <152.25dc364d@waikato.ac.nz> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 28 In article <152.25dc364d@waikato.ac.nz> ccc_ldo@waikato.ac.nz writes: > Can anybody tell me why the following program throws up an error with > MPW C 3.0? > typedef unsigned char > Str255[256]; > main() > { > Str255 > temps, *tempp; > > tempp = &temps; > } because temps is a reference to an array without an explicit index, it resolves to the address of the array itself. Thus either of these two would be just fine: tempp = temps; tempp = &temps[0]; This is the way C works... -- Sig DS.L ('ZBen') ; Ben Cranston * Network Infrastructures Group, Computer Science Center * University of Maryland at College Park * of Ulm