//:How do I convert to string? C++?
pragma once
#include <iostream>
#include <fstream>
#include <istream>
#include <string>
namespace testrun1 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
using namespace std;
private: int total;
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
std::stringstream;
std::ifstream ifs("1.txt");
std::string line;
while(std::getline(ifs, line));
std::ifstream ifs1("1a.txt");
std::string line1;
while(std::getline(ifs1, line1));
total = (line1 + line);
String^ fileName = "text1.txt";
StreamWriter^ sw = gcnew StreamWriter(fileName);
sw->WriteLine (Convert::ToString(total));
sw->Close();
}
};
}
//:The Error that I keep getting is::::
//:error C2440: '=' : cannot convert from 'std::basic_string<_Elem,_Traits,_Ax>' to 'int'