0
How can i create a program using c++ converting number to word?
sorry for my english.. but guys can u make me a program in c++ language that i can easily understand
1 Réponse
+ 5
Way 1 : Requires C++11
int a = 12323 ;
string result = to_string(a);
// This is the simplest way...
Way 2 : Requires C++11
int a = 12324 ;
string::size_info pos = 0;
string result = stoi(a,&pos,0);
// This is useful when you have
// more than one no. ...
Way 3 : Requires C++03 and <sstream> Header.
int a = 12325 ;
stringstream ss;
ss.clear();
ss << a;
string result = ss.str();
// This is useful for simultaneous
// I/O from and to the string...