S
sieg1974
Hi,
when I compile the following code with gcc, I get a warning message
complaining about the comparison between pointer and integer at the
lines market.
How can I correct this problem? And why the compiler doesn't complain
at while( opendir( newSubDirectory ) )?
Thanks,
Andre
int makeSubDir( const char * theDirectory, char * newSubDirectory )
{
int subDir = 0;
*****-> if( opendir( theDirectory ) == NULL )
return( -1 );
do
{
subDir++;
sprintf( newSubDirectory, "%s/%03d", theDirectory, subDir );
}
while( opendir( newSubDirectory ) );<--why I don't get any warning
here?
mkdir( newSubDirectory, S_IRUSR + S_IWUSR + S_IXUSR );
*****-> if( opendir( newSubDirectory ) == NULL )
return( -1 );
return( 0 );
}
when I compile the following code with gcc, I get a warning message
complaining about the comparison between pointer and integer at the
lines market.
How can I correct this problem? And why the compiler doesn't complain
at while( opendir( newSubDirectory ) )?
Thanks,
Andre
int makeSubDir( const char * theDirectory, char * newSubDirectory )
{
int subDir = 0;
*****-> if( opendir( theDirectory ) == NULL )
return( -1 );
do
{
subDir++;
sprintf( newSubDirectory, "%s/%03d", theDirectory, subDir );
}
while( opendir( newSubDirectory ) );<--why I don't get any warning
here?
mkdir( newSubDirectory, S_IRUSR + S_IWUSR + S_IXUSR );
*****-> if( opendir( newSubDirectory ) == NULL )
return( -1 );
return( 0 );
}