Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!murtoa.cs.mu.oz.au!rob From: rob@cs.mu.oz.au (Robert Wallen) Newsgroups: comp.sys.mac.programmer Subject: Re: More on MPW C 3.0 question Message-ID: <2966@murtoa.cs.mu.oz.au> Date: 22 Feb 90 10:10:39 GMT References: <162.25dfe4b3@waikato.ac.nz> <10311@hoptoad.uucp> <1629@sequent.cs.qmw.ac.uk> Reply-To: rob@murtoa.UUCP (Robert Wallen) Organization: Comp Sci, Melbourne Uni, Australia Lines: 28 In article <1629@sequent.cs.qmw.ac.uk> you write: >References: <162.25dfe4b3@waikato.ac.nz> >>"Str255 *tempp" makes no sense. You can't have a pointer to an array >>in C. The compiler should choke on this, but it doesn't. Instead, > >Please, give me a break. Why can't you have pointers to arrays in C? Agreed. However... >I mean, how do you explain `char *argv[]' and `char **argv'? >Surely, you must be familiar with this. Well, yes I am. char*argv[] is an array of POINTERS, not a pointer to an array. char**argv is a POINTER to a POINTER, not a pointer to an array. C lets you use pointers as arrays but that doesnt make them the same thing. You CAN have pointers to arrays but your example did not have anything to it I think you are thinking of char (*argv)[] >Oh, by the way; I'm pretty sure that the definition of StringPtr >goes smth. like: `typedef Str255 *StringPtr'. Looks familiar? :-) >(Haven't looked it up though...) I hadnt looked it up, but I 'knew' it was wrong so I did and ... /* from THINK_C 4.0 */ typedef unsigned char Str255[256]; typedef unsigned char * StringPtr,** StringHandle ;