Re: Offset a void pointer

Aaron Drew <[email protected]> Tue, 12 Oct 2004 23:45:08 +1000
Newsgroups gmane.games.devel.general
Message-ID <[email protected]>
The cast has the same precedence as other unary operators.

http://web.ics.purdue.edu/~cs240/misc/operators.html

In no specific order: ++  --  +  -  !  ~  &  *  (type_name)  sizeof new delete


On Tue, 12 Oct 2004 10:17 pm, CAVEY GERARD wrote:
> Hi
>
> I have little question
> It seems impossible to me to offset a void pointer with the += operator
> can someone explain me why ?
> I don t really understand the compiler here ... the left casting should
> give him the memory unit size , right?Is left casting forbidden?
>
> void *BufferPtr;
> unnsigned int stridde=5;
> //doesnt compile !
> (char*)BufferPtr+=stride;
> //will compile
> BufferPtr=(char*)BufferPtr+stride;
>
> Thanks
> GC.
>
>
> *************************************************************************
> Ce message et toutes les pieces jointes (ci-apres le "message") sont
> confidentiels et etablis a l'intention exclusive de ses destinataires.
> Toute utilisation ou diffusion non autorisee est interdite.
> Tout message electronique est susceptible d'alteration.
> SG Asset Management et ses filiales declinent toute responsabilite au titre
> de ce message s'il a ete altere, deforme ou falsifie.
>
> Decouvrez l'offre et les services de SG Asset Management sur le site
> www.sgam.fr
>
> 				********
>
> This message and any attachments (the "message") are confidential and
> intended solely for the addressees.
> Any unauthorised use or dissemination is prohibited.
> E-mails are susceptible to alteration.
> Neither SG Asset Management nor any of its subsidiaries or affiliates shall
> be liable for the message if altered, changed or falsified.
>
> *************************************************************************
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Gamedevlists-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_id=557

-- 
- Aaron

"Today's mighty oak is just yesterday's nut that held its ground."


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=557