C/C++ code#include
#include
#include
int main()
{
struct jb{
char actor[25];
struct jb *next;
};
struct jb *bond;
int n;
/* Create the first structure in the list */
bond = (struct jb *)malloc(sizeof(struct jb));
printf("struct jb sizeof is %d\n", n = sizeof(struct jb));
printf("struct bond->actor sizeof is %d\n", n = sizeof(bond->actor));
printf("struct bond->next sizeof is %d\n", n = sizeof(bond->next));
/* Fill the structure */
strcpy(bond->actor, "Sean Connery");
bond->next = NULL; /* End of list */
/* Display the results */
printf("The first structure has been created:\n");
printf("\tbond->actor = %s\n", bond->actor);
printf("\tnext structure address = %p\n", bond->next);
return(0);
}