刚学者,我这样传参数对吗?
有个int b[100],我想传过去void a( int *b)
{int *B=b}用到传过来的数组:
  int c[100]  for(int i=0;i<100;i++)
{
  c[i]=*b++;}这样对吧那如果我现在想传自定义数组呢:typedef struct tagA
{ int *a   //a代表想传过去的数组a[10]
  int c;
 }A;有个数组:A[100],想传这样个参数
过去,我应该怎样传啊,

解决方案 »

  1.   

    struct tagA{};int f(A *pA, int nNum)
    {
       for(int i=0; i < nNum; ++i)
    {
    get a struct into you memory
    }
    }
      

  2.   

    那如果我现在想传自定义数组呢:typedef struct tagA
    { int *a   //a代表想传过去的数组a[10]
      int c;
     }A;有个数组:A[100],想传这样个参数
    过去,我应该怎样传啊
    ------------------------------------------>
    int f(A *pA, int nNum)
    {
        pA[0].c=XXXX;
        int *p=pA[0].a;
        p[0]=
        p[1]=
        .....
    }
    using the above function interface ,you only should tranfer the initial address of your array and the size of array.