error C3074: an array can only be initialized with an initializer-list

Hello. I want to open a directory, get his files, unzip it and move it in another directory(7zip problem B|), then get again the file from second directory, store in a list and then process it.
I found Tinydir as a solution for getting the directory file list. Everything works fine, but when I try to insert them into list, I get:
error C3074: an array can only be initialized with an initializer-list
Google wasn't my solution :(.
What should I do to make this work ?
All this stuff is in VC12.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void do_()
{
	list <char[256]> dirList;

	tinydir_dir dir;
	tinydir_file file;
	tinydir_open(&dir, "files/");

	while (dir.has_next)
	{
		tinydir_readfile(&dir, &file);
		if (!file.is_dir) dirList.push_back(file.name);
		printf("%s\n", file.name);
		tinydir_next(&dir);
	}
	tinydir_close(&dir);
}


Thank you very much !
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void do_()
{
	// list <char[256]> dirList;

        // see: https://www.mochima.com/tutorials/strings.html
        std::list<std::string>  dirList; // *** #include <string>

	tinydir_dir dir;
	tinydir_file file;
	tinydir_open(&dir, "files/");

	while (dir.has_next)
	{
		tinydir_readfile(&dir, &file);
		if (!file.is_dir) dirList.push_back(file.name);
		printf("%s\n", file.name);
		tinydir_next(&dir);
	}
	tinydir_close(&dir);
}
Thank you very much !
Topic archived. No new replies allowed.