#include <stdio.h>
#include <stdlib.h>
#define N 10
struct Node {
char c;
int i;
struct Node *next;
};
struct Node *initNode (char c, int i);
int main () {
int j = 0;
char c;
int i;
struct Node *head = NULL;
struct Node *curr = NULL;
head = initNode ('\0', 0);
curr = head;
for (j = 0; j < N; j++) {
printf("Please enter a character and an integer: ");
scanf("%c\n%i", &c, &i);
(*curr).next = initNode(c, i);
curr = (*curr).next;
}
curr = head;
printf("\n\nChar\tInt\n");
while (curr) {
printf("%c\t%d\n", (*curr).c, (*curr).i);
curr = (*curr).next;
}
return 0;
}
struct Node *initNode (char c, int i) {
struct Node *temp;
temp = (struct Node*)malloc(sizeof(struct Node));
(*temp).next = NULL;
(*temp).c = c;
(*temp).i = i;
return temp;
}