Search the web
Sign In
New User? Sign Up
palm-dev-forum
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: SDK 4.0 Update 1 available now   Message List  
Reply | Forward Message #68871 of 92429 |
Re: SDK 4.0 Update 1 available now

On Sat, Feb 23, 2002 at 02:50:22PM +0300, Alexander Horoshilov wrote:
> >
> > Let's say p is a pointer to a _record. The compiler requires knowledge
> > of the size of the object pointed to by p (in order to support
> > operations such as p++, or declaring an instance of _record on the
> > stack, etc.). It does not matter whether or not you actually perform
> > such an operation anywhere in the code, the compiler still needs to know
> > the size of _record. Since BitmapType is a incomplete structure definition,
> > the size of _record is unknown, and so the compiler is warning you about
that.
>
> No, standard C++ compiler *should not* know the size of the object or
> the structure in order to declare the pointer to its instance, only its
> *existence*. For example, following code should be compiled by any
> ANSI/ISO C++ compiler (actually, I don't know if CW compiles this, since
> I don't use it):

Sure, and this works also in C, not only C++.
Declaring a pointer to an unknown structure is a technique fundamental
to information hiding in C.
Too often poor coded interfaces expose data structure when not
necessary (perhaps because of the ignorance of this simple language
feature).

Ciao,
Marco

--
========================================================================
Marco Pantaleoni panta@...
Padova, Italy panta@...
elastiC language developer http://www.elasticworld.org

--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/tech/support/forums/



Sat Feb 23, 2002 12:02 pm

panta@...
Send Email Send Email

Forward
Message #68871 of 92429 |
Expand Messages Author Sort by Date

Hello Jim, I was unable to prevent myself from this remark :) ... No, standard C++ compiler *should not* know the size of the object or the structure in order...
Alexander Horoshilov
hor@...
Send Email
Feb 23, 2002
11:53 am

... Sure, and this works also in C, not only C++. Declaring a pointer to an unknown structure is a technique fundamental to information hiding in C. Too often...
Marco Pantaleoni
panta@...
Send Email
Feb 23, 2002
12:12 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help