vc 文件操作

may be like this, it is abstracted from MSDN

remove, _wremove
Delete a file.

int remove( const char *path );

int _wremove( const wchar_t *path );
....................
#include <stdio.h>

void main( void )
{
   if( remove( "remove.obj" ) == -1 )
      perror( "Could not delete 'REMOVE.OBJ'" );
   else
      printf( "Deleted 'REMOVE.OBJ'\n" );
}


Output

Deleted 'REMOVE.OBJ'

posted @ 2013-05-09 17:23  boys2012  阅读(174)  评论(0编辑  收藏  举报