M
M
Makaleks2013-11-28 21:09:06
C++ / C#
Makaleks, 2013-11-28 21:09:06

C++ list files in current directory

We need a list of files in the current directory (where the program itself is) in the standard way (without including third-party libraries)
I understand correctly that the standard file functions ( ifstream, ofstream, ... ) work quite well in the current directory without any windows.h, dirent.h, boost, etc. ?..
Is it possible to get a list of files by standard means (for example, by linking "the number of files in a directory" → "get the file name (in a loop) ")?

?..
Maybe it's necessary through the possibilities <filesystem>?... I don't know. I appeal

(VC++ 2010)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sdevalex, 2013-11-28
@Makaleks

According to the standard, now, STL does not know how to do this. Use the OS API or Boost.Filesystem.

A
al_sh, 2013-12-25
@al_sh

FindFirst + FindNext

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question