while(!boudary_backup.empty())
{
char szName[50] = {'\0'};
sprintf(szName, "line/line%d.txt", index);
std::ofstream linesFile( szName );
index++;
MyPoint beginPoint, nextPoint;
beginPoint.x = boudary_backup.front().x;
beginPoint.y = boudary_backup.front().y;
linesFile << beginPoint.x << " " << beginPoint.y << std::endl;
boudary_backup.erase(boudary_backup.begin());
while (HaveNeighbor(beginPoint, nextPoint))
{
beginPoint = nextPoint;
linesFile << beginPoint.x << " " << beginPoint.y << std::endl;
}
}
c++ 循环创建不同名的txt
最新推荐文章于 2024-03-04 14:29:05 发布