How can i use Itow() or wtoi() functions in Sun Solaris Sparc?

V

Vinu

Hi
How can i use Itow(),_itow(),wtoi() or _wtoi() functions in Sun Solaris
Sparc?


Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .


Thanks
Vinu
 
M

msalters

Vinu schreef:
Hi
How can i use Itow(),_itow(),wtoi() or _wtoi() functions in Sun Solaris
Sparc?

Don't. The _ prefix is there to warn you you're using non-standard
stuff. The Standard C++ way is <sstream>

HTH,
Michiel Salters
 
V

Vinu

Hello

Then what is the way to convert int to a wide character Can you suggest
standard way of doing it.

Thanks
Vinu
 
P

philip.goh

It has already been mentioned, use <sstream>

#include <iostream>
#include <string>
#include <sstream>
#include <cwchar>

using namespace std;

int main (int argc, char * const argv[]) {
wstringstream s;
int x;
wcout<< "Enter an integer : ";
wcin >> x;

s << "Value entered is : " << x;
wcout<<s.str();

return 0;
}


HTH,
Philip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top