Is hard to understand what you mean but probably you ask about pointer arithmetic.
In c language *(pointer + i)
=== pointer[i]
and pointer + i
=== &pointer[i]
so your code using the pointer arithmetic instead of indexes:
int* input = malloc (sizeof(*input)*nummers);
for (int i = 0; i < nummers; ++i) {
printf("Nummer %d:", i+1);
scanf("%d", input + i);
}
for (int i = 0; i < nummers; ++i) {
printf("Nummer %d is: %d
", i + 1, *(input + i));
}
free(input);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…