I'm trying to pass a pointer from main to a function I wrote, which suppose to allocate memory with the size integer and receive input from the user.
Now I know I'm doing something wrong because the pointer doesn't change back in the main function. could someone tell me what exactly I did wrong?
int rows, *newCol=NULL // the pointer inside main();//rows is the size of the array.
the function:
void buildArr(int *newCol, int rows);
void buildArr(int *newCol, int rows)
{
    int i;
    newCol = (int*)malloc(sizeof(int)*rows);
    for (i = 0; i<rows; i++)
    {
        printf("enter the value of the newCol:\n");
        printf("value #%d\n", i + 1);
        scanf("%d", &newCol[i]);
    }
}
 
    