Home
Forums
Programming
Web Development
Tutorials
Snippets
Blogs
Freelance
Jobs
Lounge
Login
Join for Free!
Programming Help
C and C++
Visual Basic
Java
VB.NET
C#
ASP.NET
PHP
ColdFusion
Perl and Python
Ruby
Databases
Other Languages
Game Programming
Software Development
Computer Science
Industry News
Web Development
Web Development
HTML & CSS
JavaScript
Graphic Design
Flash & ActionScript
Blogging
SEO & Advertising
Web Servers & Hosting
Site Check
What's Here?
Members:
148,902
Replies:
505,044
Topics:
79,544
Snippets:
2,661
Tutorials:
705
Total Online:
2,315
Members:
110
Guests:
2,205
Code Snippets
C++ Source Code
Welcome to Dream.In.Code
Become a C++ Expert!
Join 148,902 C++ Programmers for FREE!
Get instant access to thousands
of C++ experts, tutorials, code snippets, and more! There are 2,315 people online right now.
Registration is fast and FREE...
Join Now!
Chat
LIVE
With a C++ Expert
Integer to string conversion
Program uses std::ostringstream which is defined in sstream to convert integer to string.
Submitted By:
Xing
Actions:
Rating:
0
1
2
3
4
5
Views:
27,353
Language:
C++
Last Modified:
November 20, 2006
Snippet
#include <iostream>
#include <sstream>
int
main
(
)
{
std::
ostringstream
stm;
// Output an int
stm <<
2500
;
// Retrieve the resulting string
std::
cout
<< stm.
str
(
)
;
return
0
;
}
Copy & Paste
#include <iostream> #include <sstream> int main() { std::ostringstream stm; // Output an int stm << 2500; // Retrieve the resulting string std::cout << stm.str() ; return 0; }
Comments
There are currently no comments for this snippet. Be the first to comment!
Add comment
You must be registered and logged on to </dream.in.code> to leave comments.
Advertising
|
Terms of Use
|
Privacy Policy
|
About Us
|
Site Map
Forum Index:
Programming Help
|
C and C++
|
Visual Basic
|
Java
|
VB.NET
|
C#
|
ASP.NET
|
PHP
|
ColdFusion
|
Perl and Python
|
Ruby
|
Databases
|
Other Languages
|
Game Programming
|
Software Development
|
Computer Science
|
Industry News
|
Programming Tutorials
|
C++ Tutorials
|
Visual Basic Tutorials
|
Java Tutorials
|
VB.NET Tutorials
|
C# Tutorials
|
Linux Tutorials
|
PHP Tutorials
|
ColdFusion Tutorials
|
Windows Tutorials
|
HTML/JavaScript Tutorials
|
CSS Tutorials
|
Flash Tutorials
|
Web Promotion Tutorials
|
Photoshop Tutorials
|
Software Development Tutorials
|
Database Tutorials
|
Other Language Tutorials
|
ASP.NET Tutorials
|
Copyright 2001-2008
MediaGroup1 LLC
, All Rights Reserved
A
MediaGroup1 LLC
Production - Version 6.0.2.1.36
Server: secure2
Search
Updated!
w00t
Over 509,000 Pages!
Advanced Forum Search
Be Social
Live C++ Help!
C++ Tutorials
Data Structures In C++ Tutorial
C++ Quick Reference Sheet (Cheat Sheet)
Making a 2D Game Engine Using OpenGL - Part3 is up
CPP with ODBC (Open Database Connectivity)
Object Oriented Programming (oop) Tutorial
Polymorphism Tutorial
C++ Vector Tutorial
Understanding Loops in C++
Converting and Evaluating Infix, Postfix and Prefix Expressions in C
Producing Random Numbers
116 More C++ Tutorials...
Reference Sheets
C++ Snippets
Linked List Class
Convert cases of strings
Getting Current Directory
Recursive Fibonacci Sequence
Shortest Function to Reverse a String ( Uses Recursion )
Insertion Sort Example
Finding Square Root without using sqrt()
Convert characters into a ASCII value and vice versa
integer to string conversion
Complex Numbers Class
458 More C++ Snippets...
DIC Chatroom
Join our IRC Chat
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
girasquid
(50)
Barnz
(50)
DillonSalsman
(50)
jacobjordan
(50)
kryton46
(50)
~NJ
(25)
snoj
(25)
KYA
(25)
gothik12
(25)
mostyfriedman
(25)