Well in Linux / Unix / any POSIX operating system, use stat() as mentioned already
If you want a win32 function, use
> but i'm looking for a c++ function
No such thing - functions don't care what language they're written in, or what language the caller is written in.
C++ is about classes and encapsulation of data - when it gets down to the gritty detail of actually getting some work done, it's all about functions.