迭代vector
vector<vector<string> > output_area_files;
for
(
int
i = 0; i < testfiles.size(); i++)
{
vector
<
string
> single_area_files;
single_area_files = CTF_detect(test_image, 200, single_area_files);
output_area_files.push_back(single_area_files);
ofstream
area_statistics_file;
area_statistics_file.open(
"AreaStatistics.txt"
);
if
(!area_statistics_file)
{
cout <<
"TXT文件不存在"
<< endl;
}
else
{
for
(
int
i = 0; i < output_area_files.size(); i++)
{
vector
<
string
> single_area_files = output_area_files[i];
for
(
int
j = 0; j < single_area_files.size(); j++)
{
area_statistics_file << single_area_files[j] <<
"\n\r"
<< endl;
}
}
}
}