Comment on Tutorial - atoi(), itoa() in C++ By Manoj Kumar
Comment Added by : Anonymous
Comment Added at : 2009-06-07 21:00:18
Comment on Tutorial : atoi(), itoa() in C++ By Manoj Kumar
i'm really hoping this example was wrote before 1998, you know, before c++ standard
iostream.h isn't in c++ standard, only iostream is, and after that using namespace std is missing or use std::cout...
And if you write pure c++ code try using cstdlib instead of stdlib.h and start using std::string instead of char[].
And example of converting string to integer:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
int number;
string stringNumber;
stringstream ss;
cin >> stringNumber;
ss << stringNumber;
ss >> number;
cout << "you have typed: " << number << endl;
return 0;
}
View Tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Archived Comments
1. sir i need some simple example of jdbc i cannot un
View Tutorial By: Velkumar.s at 2013-05-15 07:08:37
2. Hiiii
When I am executing
View Tutorial By: Souvik Bhattacharya at 2008-08-18 00:21:31
3. hi sir i want to know source code of this program;
View Tutorial By: rishabh at 2010-08-21 09:30:31
4. Hey thanks for your tutorial. But i'm getting an e
View Tutorial By: acc at 2013-07-25 14:30:50
5. Very nice introduction to j2me well you should als
View Tutorial By: Bikashjit at 2012-08-29 08:53:28
6. I want to enter data from a textbox to recordstor
View Tutorial By: Rahul Maurya at 2010-04-10 01:04:51
7. I tried this with HttpUnit (using the custom Hostn
View Tutorial By: Michael Gower at 2012-01-04 17:40:00
8. Thanks!! This example was very helpful for me...
View Tutorial By: Jonathas at 2010-03-11 07:47:51
9. I'd like to Thanks first bcoz your program is real
View Tutorial By: Pawan at 2012-04-24 19:46:00
10. In listing 6.2 I don't see the variable name itsAg
View Tutorial By: JC at 2013-04-16 01:49:52