Afficher un message
Vieux 17/10/2007, 14h12   #3
Jim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Pointers to structs - !

On 2007-10-17, Mark Bluemel <mark_bluemel@pobox.com> wrote:
>
> theRecord.clno is a pointer to unsigned long. Subtracting 1 from it
> moves it "back" (for some value of back) by sizeof(unsigned long). Again
> you pass printf() two pointers but tell it that they are longs, again
> you "get away" with it...


Barely, it would seem.

> Your code would work acceptably simply by amending the structure to
> contain unsigned longs, rather than pointers to them, and removing the
> mallocs...


Done and it now works as expected. Many thanks, and I'll try to get this
into my head in future.

Jim
--
http://www.ursaMinorBeta.co.uk
BRADWORTHY (n.)
One who is skilled in the art of naming loaves.
  Réponse avec citation
 
Page generated in 0,04412 seconds with 9 queries