The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 conversion int -> string/char
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ukk98

Poland
Posts

Posted - 11/16/2007 :  06:51:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (7.0):
Operating System winXP:

I have a question. How can i convert an int to string/char ? I cant use sprintf or itoa. Maybe other function ? Or should I make my own ?

Mike Buess

USA
3037 Posts

Posted - 11/16/2007 :  08:59:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Why can't you use sprintf? It compiles and works fine in 7.0 SR4. (Try the example in programming guide.) You can also use string::Format and can even use an integer without a conversion function...

string str = "hello";
int i = 5;
string str2 = str + i;
out_str(str2);

>>hello5

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/16/2007 09:03:15 AM
Go to Top of Page

ukk98

Poland
Posts

Posted - 11/16/2007 :  10:03:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have only 7.0 SR2. But i have solved this problem. I made my own conversion function.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000