Answers for "how to print a pointer array in c"

C
2

how to print a pointer array in c

#include <stdio.h>
int main() {
    int data[5];

    printf("Enter elements: ");
    for (int i = 0; i < 5; ++i)
        scanf("%d", data + i);

    printf("You entered: \n");
    for (int i = 0; i < 5; ++i)
        printf("%d\n", *(data + i));
    return 0;
}
Posted by: Guest on May-24-2020

Code answers related to "how to print a pointer array in c"

Code answers related to "C"

Browse Popular Code Answers by Language