Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- typedef struct Node
- {
- char data;
- struct Node* next;
- } node;
- node *create_node(char data)
- {
- node* temp = (node*)malloc(sizeof(node));
- temp->data = data;
- temp->next = NULL;
- return temp;
- }
- // node* insert
- void print_list(node* head)
- {
- if(head == NULL)
- {
- printf("List is empty\n");
- }
- node* temp = head;
- while (temp != NULL)
- {
- printf("%c->", temp->data);
- temp = temp->next;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement