Posts by Incognite • 1 point
1 post
-
0
votes2
answers85
viewsQ: Segmentation Fault with malloc()
In one part of my program I need to create a vector full of zeros the size of the user’s interval: scanf("%ld %ld", &n1, &n2); int *vetor; vetor = malloc((n2 - n1 + 1) * sizeof(long int));…