473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Simple question about string type

Hi

In my program i have:

string s;
int i;

how can i easily add integer type to s ??

for example if i have int i = 5, i want to have after this string s =
"5"

Nov 9 '05 #1
2 1434
peter_k wrote:
Hi

In my program i have:

string s;
int i;

how can i easily add integer type to s ??

for example if i have int i = 5, i want to have after this string s =
"5"


http://www.parashift.com/c++-faq-lit....html#faq-39.1

There's lots of useful information like that in the FAQ

Gavin Deane

Nov 9 '05 #2
In article <11**********************@g49g2000cwa.googlegroups .com>,
peter_k <as**@o2.pl> wrote:
In my program i have:

string s;
int i;

how can i easily add integer type to s ??

for example if i have int i = 5, i want to have after this string s =
"5"


Check out http://www.comeaucomputing.com/techtalk/#noitoa
--
Greg Comeau / Celebrating 20 years of Comeauity!
Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Pavils Jurjans | last post by:
Hello, Here's an excerpt from msdn online documentation: An index is the position of a Char, not a Unicode character, in a String. An index is a zero-based, nonnegative number starting from...
2
by: TGF | last post by:
How do you copy a String type into a native char buffer? Dumb question, but not sure how to do it :( TGF
9
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Is it possible to alter the string type? Basicly what i want to do is to create my own string type. lets call it sqlString, when i use this it will always use replace on the string...
2
by: black(flashing vampire) | last post by:
hi all~ i'm newbie to C++ string type and get confused when trying to convert an int into string, i just want my cute messagebox to popup mouse positions, here is my code: MessageBox(NULL,...
3
by: Alex K. | last post by:
Hi all I need a string type with only three possible values: let's say "A", "B", "C". In other words, I need something like enum but of string type: enum MyStrings { sA = "A", sB = "B", sC...
15
by: Lighter | last post by:
I find a BIG bug of VS 2005 about string class! #include <iostream> #include <string> using namespace std; string GetStr() { return string("Hello");
1
by: Mike | last post by:
Hi, I'm passing a JSON-encoded string to json_decode() and am expecting its output to be an object type, but am getting a string type instead. How can I return an object? In the docs, the...
1
by: kenneth6 | last post by:
ctype.h: toupper(c), tolower(c): change case of char isalphanum(c), isalpha(c), isdigit(c), ispunct(c), isspace(c), iscntrl(c), islower(c), isupper(c): boolean checks on type of char i know...
1
by: kenneth6 | last post by:
I am writing sth about data in string type in console mode. now, I transform it to Windows Form Application, i know managed type should be used here instead of the unmanaged type. should I change...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.