If you want OS independence use the C runtime library.
This should work for UNIX, Windows, and DOS going back several revs.
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
.
.
.
struct _stat s;
if ( 0 == _stat( "c:\\somepath\\somefile.ext", &s ) ) {
/* the...