Â
#include <stdio.h>
int main()
{
char x[] = {'A','B','C','D','E'};
char *ptr = x; // points to the 0th element of array
//accessing elements of array using pointers
for (int i = 0; i < 5; i++)
{
printf("%c ", *(ptr + i)); // add i to the 0th element
}
return 0;
}
//..........Coded by Ananya Maurya
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP