Matlab中:
save(['patterns\' num2str(i) 'P.txt'], 'pattern1', '-ASCII');
VS中:
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
string convertInt(int number)
{
stringstream ss;//create a stringstream
ss << number;//add number to the stream
return ss.str();//return a string with the contents of the stream
}
例子1:
ifstream fin_path("Config4.txt");
int time_folder[6];
fin_path>>time_folder[0];
fin_path>>time_folder[1];
fin_path>>time_folder[2];
fin_path>>time_folder[3];
fin_path>>time_folder[4];
fin_