[En-Nut-Discussion] pointer don't work?

Nathan Moore nategoose at gmail.com
Thu May 12 16:20:36 CEST 2011


> > pointer = &buff;                               // should set a pointer
>

This line is an error.  You're probably getting a warning about it from your
compiler telling you that you are making an assignment without a cast.

   pointer = buff;

That's what you want to do because you don't want the address of the buff
variable, but you do want the value of the buff variable, which is the
address of the malloc-ed memory.

This is basic C



More information about the En-Nut-Discussion mailing list