Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > previous declar...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 13 Topic 26048 of 26198
Post > Topic >>

previous declaration of Table was here / conflicting types for

by "Michael.Z" <zhangqiuyuan@[EMAIL PROTECTED] > May 3, 2008 at 12:22 AM

Anyone who can help:

Given a Table.h file I am writing a Table.c file.
I keep getting the compile error:

previous declaration of Table was here /  conflicting types for


I think the problem was the result of two pieces of code.
First: typedef struct Table;  /* in Table.c*/
Second: struct Table { /*struct definition */ }  *Table;  /* in
Table.h */

How can I solve the problems?



Here are the two files


/* * * * * * * * * * * * * * * * * * * * * * *
Header file:
 * * * * * * * * * * * * * * * * * * * * * * */


#ifndef TABLE_H
#define TABLE_H


#include "bool.h"

typedef void * Table ;
typedef void * DataT ;

typedef struct {
	// unsigned successful ; double unsuccessful ;
	unsigned successfulNumerator , successfulDenominator ;
	unsigned unsuccessfulNumerator , unsuccessfulDenominator ;
} Perform ;

Table
makeTable ( int sizeTable , unsigned sizeData , int  (*diff)() ,
		unsigned (*hash)() , void * (*copy)() , void (*free)() ) ;


#endif



/* * * * * * * * * * * * * * * * * * * * * * *
Table.c
 * * * * * * * * * * * * * * * * * * * * * * */

#include "Table.h"


typedef struct Table{
    int sizeTable;
    unsigned sizeData;
    int (*diff)();
    unsigned (*hash)();
    void *(*copy)();
    void (*free)();
} * Table;

Table
makeTable ( int sizeTable , unsigned sizeData , int  (*diff)() ,
		unsigned (*hash)() , void * (*copy)() , void (*free)() ) {
    }




 13 Posts in Topic:
previous declaration of Table was here / conflicting types for
"Michael.Z" <  2008-05-03 00:22:21 
Re: previous declaration of Table was here / conflicting types
ade ishs <no-spam@[EMA  2008-05-03 19:34:39 
Re: previous declaration of Table was here / conflicting types
Flash Gordon <spam@[EM  2008-05-03 10:32:51 
Re: previous declaration of Table was here / conflicting types f
"Michael.Z" <  2008-05-05 19:33:26 
Re: previous declaration of Table was here / conflicting types f
Nick Keighley <nick_ke  2008-05-06 02:21:25 
Re: previous declaration of Table was here / conflicting types f
Ben Bacarisse <ben.use  2008-05-06 12:32:13 
Re: previous declaration of Table was here / conflicting types f
"Michael.Z" <  2008-05-07 01:05:08 
Re: previous declaration of Table was here / conflicting types f
Flash Gordon <spam@[EM  2008-05-07 19:14:36 
Re: previous declaration of Table was here / conflicting types f
CBFalconer <cbfalconer  2008-05-07 12:01:43 
Re: previous declaration of Table was here / conflicting types f
"Michael.Zhang"  2008-05-09 02:40:34 
Re: previous declaration of Table was here / conflicting types f
Chris Torek <nospam@[E  2008-05-10 05:43:46 
Re: previous declaration of Table was here / conflicting types f
Ben Bacarisse <ben.use  2008-05-10 01:19:38 
Re: previous declaration of Table was here / conflicting types f
"Michael.Zhang"  2008-05-10 20:11:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:43:51 CDT 2008.