Re: Help - how to pass an array of struct from one module to another?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 10, 2004 at 21:57:43 +0200, Jan Hudec wrote:
> On Thu, Jun 10, 2004 at 11:12:51 -0700, l x wrote:
> > What I missed and how to pass an array of struct from
> > one module to another?
> > [snap]
> > void modA_func_1(void * ptr)
> > {
> >     A_struct *pA;
> >     int i;
> > 
> >     pA = (A_struct *) kmalloc(3*sizeof(A_struct));
> > 
> >     for(i=0; i<3; i++)
> >         pA[0].i = i * 10;
> > 
> >     ptr = pA;
> > }
> > [snap]
> 
> You have missed something from C. Learn C and then come back.

Oh, and in addition to there being a bug, there is a simpler solution.
It has something to do with what is a symbol (hint: no, NOT a function)

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux