// Example 715: string array and pointer operation
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *ptr[3] = {"aa", "dogs", "Elephant"};
int i;
for (i=0 ; i<3 ; i++){
// pointer[index] to represent a string
// the content(adderss or string) dep on %d or %p
printf("ptr[%d] = %s\t", i, ptr[i]); // %s - pointer[index]
printf("address = %p\n", ptr[i]); // %p - pointer[index]
}
printf("using pointer to allocate memory dynamically\n");
system("pause");
return 0;
}