Re: [GD-General] Offset a void pointer
Brought to you by:
vexxed72
From: Dan T. <da...@ar...> - 2004-10-12 17:08:18
|
Is there any problem with: BufferPtr = (char*)BufferPtr + stride; ? Compiles for me... certainly easier to read than (char*&)BufferPtr. Is one subtly faster than the in a way I'm not aware? -Dan Richard Fabian wrote: >just add an ampersand to your cast to make it a reference pointer not >just a pointer > >void *BufferPtr; >unnsigned int stride=5; >// should now compile >(char*&)BufferPtr+=stride; > > >On Tue, 12 Oct 2004 14:17:14 +0200, CAVEY GERARD <ger...@sg...> 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 >>Gam...@li... >>https://lists.sourceforge.net/lists/listinfo/gamedevlists-general >>Archives: >>http://sourceforge.net/mailarchive/forum.php?forum_id=557 >> >> >> > > >------------------------------------------------------- >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 >Gam...@li... >https://lists.sourceforge.net/lists/listinfo/gamedevlists-general >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_id=557 > > > > |