Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Pointers on pointers. Message-ID: <15729@smoke.brl.mil> Date: 6 Apr 91 00:12:48 GMT References: <1991Apr5.173843.2435@bnlux1.bnl.gov> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 18 In article <1991Apr5.173843.2435@bnlux1.bnl.gov> reilly@bnlux1.bnl.gov (kevin reilly) writes: >If dataType1 is known in advance as containing only ints can I do the >following: >declaration: void FUNC1(int *input); >usage: FUNC1(&strType.data1); >as opposed to the more correct procedure: >declaration: void FUNC1(dataType *input); >usage: FUNC1(&strType.data1); If representation of pointer-to-int happens not to use the same scheme as representation of pointer-to-structure, then using the incorrect type would probably result in a malfunction. You could also invoke the function with argument &strType.data1.x, where "x" is the name of the first (int) member of the structure. A more general comment is that there appears to be an imperfect implementation of data abstraction underlying this example.