Created
June 11, 2012 08:22
-
-
Save krofna/2909060 to your computer and use it in GitHub Desktop.
Za Mislava
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <string> | |
using namespace std; | |
inline string IntToString(int Integer) | |
{ | |
stringstream convert; | |
convert << Integer; | |
return convert.str(); | |
} | |
int StringToInt(const string& string) | |
{ | |
stringstream buffer(string); | |
int a; | |
buffer >> a; | |
return a; | |
} | |
int main() | |
{ | |
int polje[3] = { 5, 2, 3}; | |
string polje_s; | |
int polje_i; | |
for(int i=0; polje[i]; ++i) | |
{ | |
polje_s += IntToString(polje[i]); | |
} | |
polje_i = StringToInt(polje_s); | |
cout << polje_i << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment