Cheeers. I just ran it under cygwin and its running fine. I think its just that I was still using fwrite. Just means I have to have a read on fprintf again. Thank you so much for the help. Now that thats done, the uncompression shouldnt be too hard.
Thanks again,
Johannes
PS: Would this work? At the moment its complaining bout the strncpy use.
Code:
char * strcompare( char *ptrstr, char *ptroldstr )
{
int i;
char * temp;
temp = malloc ( 80 * sizeof *temp);
if( strlen( ptroldstr ) == 0 )
{
strcpy(ptroldstr,ptrstr);
return 0;
}
for( i = 0; i < strlen( ptrstr ); ++i)
{
if( isdigit( *( ptrstr + i ) ) != 0 )
{
if( *( ptrstr + i ) == '0' )
{
temp = strstr( ptrstr, "0" );
strcpy( ptrstr, temp );
}
strncpy( ptrstr, *( ptrstr + i ), strlen( ptrstr ) );
}
}
strcpy( ptroldstr, &ptrstr[ i ] );
return ptrstr;
}
It wouldnt let me attach the file so I accidentaly started a new thread. The file and another question is under "slightly got lost and confused".Sorry, I know you probably have better things to do but I really appreciate all the help. May be one day I understand enough to be of help to others too.
Cheers, Johannes
"You gotta hate programming to love it. The more you hate it the more you love it!"