c++ - Why is there no cdirent or sys/cstat -
i writing c++ code iterates through entries of directory , decided use dirent.h. since using c++, decided use c++ standard including c library files [i.e. prefixing library name c , removing .h @ end]
without adding functionality decided compile program once see if there cdirent
or sys/cstat
. g++ threw error telling me these files not present
#include <iostream> #include <cdirent> #include <sys/cstat> #include <sys/ctypes> using namespace std; int main() { } dummy.cpp:2:19: error: cdirent: no such file or directory dummy.cpp:3:21: error: sys/cstat: no such file or directory dummy.cpp:4:22: error: sys/ctypes: no such file or directory
following advice given in page on standard c++ header files locate cstdio
, cstdlib
, ctime
, brings me questions
- when c standard library file converted c++ standard library file?
- how should 1 include such files in program? page here talks standard , non standard header files. believe
dirent.h
standard library file [correct me if wrong]
thanks in advance suggestions
dirent.h
, sys/stat.h
posix/sus headers rather standard c/c++ headers, , such not adhere standard c++ rules.
Comments
Post a Comment