Cita:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
// De String a Int
string string1 = ("43");
stringstream buffer(string1);
int x;
buffer >> x;
x = x*5;
cout << x << endl;
// De Int a String
int y = 5;
stringstream buffer2;
buffer2 << y;
string string2 = buffer2.str();
string2 += (" es el numero.");
cout << string2 << endl;
system("PAUSE");
return 0;
}
#include <string>
#include <sstream>
using namespace std;
int main()
{
// De String a Int
string string1 = ("43");
stringstream buffer(string1);
int x;
buffer >> x;
x = x*5;
cout << x << endl;
// De Int a String
int y = 5;
stringstream buffer2;
buffer2 << y;
string string2 = buffer2.str();
string2 += (" es el numero.");
cout << string2 << endl;
system("PAUSE");
return 0;
}