stl 输入输出代码 int 转string string 转int 与分割字符串

	string filename = "D:\\data\\kap.txt";

	for (size_t i=0; i<kap.size();i++)
	{
		
		ostringstream ss;
		ss <<i;
		ofstream  f(filename+ss.str());
		ss.clear();
		if (!f)
		{
			::MessageBox(NULL,L"log put out error!!!  ",L"Error",MB_OK); 
		}
		for (size_t j=0; j<kap[i].size();j++)
		{
			f<<kap[i][j].x<<" "<<kap[i][j].y<<std::endl;
		}
		f.close();
	}
		ostringstream ss;
		ss <<i;





	std::string kappath= "D:\\data\\kap.txt";
	std::string tempstr;
	std::vector< std::vector<double> > linepoints;
	std::vector<double> tempvect;
	std::ifstream freaddata(kappath);
	double temp;

	while (std::getline(freaddata,tempstr));
	{
		std::istringstream spline(tempstr);
		while(spline >> temp)
		{
			tempvect.push_back(temp);
		}

		linepoints.push_back(tempvect);
		//display the point
		gp_XYZ currentPoint(tempvect[0],tempvect[1],0);
		DisplayPoint(aDoc, gp_Pnt(currentPoint),"",false,0.1);
		tempvect.clear();
	}
	
	freaddata.close();
		std::istringstream spline(tempstr);
		while(spline >> temp)















   

你可能感兴趣的:(stl 输入输出代码 int 转string string 转int 与分割字符串)