Sep 16, 2010 at 8:33am UTC
struct
struc
{ char Chars[4];
float Floats[3057];
};
Void Accessor(char* Chars, char Char){;}
void main()
{
struc Struc;
Accessor(&Struc.Chars[1],'1'); //Is it correct?
return void;
};
Will the Accessor be able to read/write the Struc Chars as applied with
(&) operator and why?
Sep 16, 2010 at 8:49am UTC
Hello Los Guianosotros Finitar,
& is in this case the 'address of'-operator. And what you get is the address of the second char of your struct (0 would be the first or Accessor(Struc.Chars,'0' );
)
Sep 16, 2010 at 9:13am UTC
I don't understand. Is it calculate the addres of Struc or converts line of code
or what does do as applied?
Sep 16, 2010 at 9:28am UTC
it calculates address of Struc + offset of Chars + 1
Sep 16, 2010 at 9:53am UTC
O, thanks. Guess so too nobuddy nowhere explain but this site.