Do you know why it gives me those errors? I dont see where it could get them from. I have put the function prototypes back into the main .c program and changed a few things with the return types as I dont think I need them, using ptrs and linked lists.
Here an extract of the error messages and the function that it complains the most about:
Code:
regatta.c:30: two or more data types in declaration of `CreateMaster'
regatta.c:91: `CreateMaster' redeclared as different kind of symbol
regatta.c:30: previous declaration of `CreateMaster'
regatta.c: In function `CheckString':
regatta.c:127: parse error before `Participants'
regatta.c:140: warning: passing arg 1 of `strstr' makes pointer from integer wit
hout a cast
regatta.c:143: warning: passing arg 1 of `strstr' makes pointer from integer wit
hout a cast
Code:
void CheckString( char *ptrdata )
{
Boat *boatptr;
BoatType *typeptr;
/*counter*/
int i, j = 0;
/*temporary variables for read strings*/
char *ptrSail, *ptrClassType, *ptrBoatName;
/*allocate space for pointers*/
ptrSail = malloc( sizeof *ptrSail );
ptrClassType = malloc( sizeof *ptrClassType );
ptrBoatName = malloc( sizeof *ptrBoatName );
boatptr = malloc( sizeof( Boat ) );
typeptr = malloc( sizeof( BoatType ) );
boatptr = Participants[ j ];
for( i = 0; i < 80; ++i )
{
if( isdigit( ptrdata[ i ] ) != 0 )
strcpy( boatptr->SailNum, ptrdata );
if( isalpha( ptrdata[ i ] ) != 0 )
{
if( strstr( ptrdata, "Gwen" ) )
strcpy( ptrClassType, ptrdata );
/*if boat type is Thorpe copy what follows from that point onwards*/
else if( strstr( *ptrdata, "Thorpe" ) )
strcpy( ptrClassType, ptrdata );
/*if boat type is Skiff copy what follows from that point onwards*/
else if( strstr( *ptrdata, "Skiff" ) )
strcpy( ptrClassType, ptrdata );
/*else it is the boat name so copy to pointer*/
strcpy( boatptr->BoatName, ptrdata );
}
}
++j;
}
Thanks heaps for having a look at the stuff. Ta,
Johannes