[Solved] Why i cant make this series by C code?


You need to something like this.

void function(int *);

int main()
{
    int g[20],N;                  // array g local to main funciton
    printf("Type N");
    scanf("%d",&N);
    function(g);            // invoke function by passing array base address as an argument
    printf("s[0] is %d\n",g[0]);   // the first three positions of the g array
    printf("s[1] is %d\n",g[1]);  // have not been set by function
    printf("s[2] is %d\n",g[2]);  // they are also all unknown values

}

void function(int *s){ 
    s[0]=1;       //*(s+0)      
    s[1]=3;     
    s[2]=5;

}

0

solved Why i cant make this series by C code?