node redefinition

Write your question here.

// merge.h
struct node {
int info;
struct node *next;
};
void divideList(struct node *,struct node **);
struct node * mergeList(struct node *,struct node *);
void recMergeSort(struct node **);
void mergeSort(struct node **, struct node **);

// main.c



#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "merge.h"
#include "merge.c"


int main()
{
char str [10];
char str1 [10];

printf ( "Enter your list in list1: ");
scanf("%9s" ,str);

printf (" Enter your list in list2: ");
scanf("%9s" ,str1);

recMergeSort(str);


return 0;
}

the compiler said I redefined node. I dont know how to edit.
Last edited on
 
#include "merge.c" 


You didn't show us merge.c, but I'll bet that merge.c includes merge.h, which makes for two inclusions of merge.h which does not have include guards.

You should NEVER include a .c or .cpp file.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
http://v2.cplusplus.com/articles/jEywvCM9/
It makes it easier to read your code and it also makes it easier to respond to your post.
Hint: You can edit your previous post, highlight your code and press the <> formatting button.
Topic archived. No new replies allowed.