#include <stdio.h>

int main() {
    int a[5] = {1,2,3,4,5};
    int *p = a;
    int i;

    printf("array prima della modifica:\n");
    for(i=0; i<5; i++) {
        printf("a[%d] = %d\n", i, a[i]);
    }

    for(i=0; i<5; i++) {
        *(p+i) = *(p+i)*2;   //*(p+i)*=2
    }

    printf("\narray prima della modifica:\n");
    for(i=0; i<5; i++) {
        printf("a[%d] = %d\n", i, a[i]);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: