Small program that uses pointers to sum integers
问题 I need to create a program which calculates the cumulative sum of a dynamically allocated vector and the vector should be filled with random values (not values from stdin) using only pointers . I couldn't think of a version that uses only pointers (i'm kinda new to this matter). This is the code I have so far: #include <stdio.h> #include <malloc.h> int main() { int i, n, sum = 0; int *a; printf("Define size of your array A \n"); scanf("%d", &n); a = (int *)malloc(n * sizeof(int)); printf(