char* Title = "Demo Array of Pointers";
#include <stdio.h>
struct cat
{
int number;
struct cat* next;
};
struct cat dog[10];
#define dimensionof(p) (sizeof(p)/sizeof(p[0]))
int main()
{
printf("%s\n", Title);
for (int i=0; i<dimensionof(dog); i++)
{
dog[i].number = i;
if (i<dimensionof(dog)-1)
dog[i].next = &dog[i+1];
else
dog[i].next = NULL;
}
struct cat* ptr = &dog[0];
while (ptr != NULL)
{
printf("%d\n", ptr->number);
ptr = ptr->next;
}
printf("%d\n", ptr->number);
return 0;
}