#include <iostream.h>
#include <filesystem>
using namespace std;
int main(int argc, char *argv[])
{
for(int i=0;i<argc;i++)
{
cout<<"Argument"<<i<<":"<<argv[i]<<endl;
}
for (directory_iterator itr(directory_entry); itr!=directory_iterator(); ++itr)
{
}
return 0;
}
#include <iostream>
#include <filesystem>
#include <string>
using namespace std;
using namespace std::filesystem;
int main(int argc, char *argv[])
{
for (int i = 0; i < argc; i++)
{
cout << "Argument" << i << ":" << argv[i] << endl;
}
uintmax_t i_MaxFileSize = 0;
string s_MaxFileName="";
for (directory_iterator itr("e:\\video\\"); itr != directory_iterator(); ++itr)
{
if (itr->is_directory())continue;
if (itr->file_size() > i_MaxFileSize)
{
i_MaxFileSize = itr->file_size();
//s_MaxFileName = itr->path().string(); полный путь
s_MaxFileName = itr->path().filename().string();//только имя файла
}
}
cout << "The max file size is " << s_MaxFileName << endl;
return 0;
}