Posts by JohnR- • 1 point
1 post
-
0
votes0
answers38
viewsQ: Why do I get "Segmentation Fault", but if I remove * in the printf call it doesn’t happen?
int alloc(int * pointer, int num){ scanf("%d", &num); pointer = (int *) malloc(num*sizeof(int)); return(*pointer); } int main(){ int *pointer; int num; …