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



Subscribe to Tutorials

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

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions 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

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Good and Simple Example For Beginners Like me.Than
View Tutorial          By: Lasantha Bandara at 2010-06-29 19:21:48

2. This site is sufficient for learning the programmi
View Tutorial          By: Shaheryar Khlaid at 2011-07-25 20:36:01

3. the difference is of great important for new comme
View Tutorial          By: ramesh shetty at 2013-03-12 15:27:23

4. Good Work ...
View Tutorial          By: Sagan at 2013-08-13 13:38:30

5. This is great, hope to learn more from this commun
View Tutorial          By: Wamaguru at 2014-07-12 09:05:30

6. Very nice and easy to understand, keep it up !!
View Tutorial          By: claudiu at 2010-02-07 06:12:30

7. Good tutorial sir
View Tutorial          By: vinay at 2012-01-28 12:38:30

8. The DirSync sync intervals can be changed.

View Tutorial          By: Nitin at 2012-12-22 16:20:38

9. I want get data from Mysql into Spinner by using P
View Tutorial          By: Dilsha at 2013-07-06 05:17:58

10. Very Nice and Concrete Explanation ..
View Tutorial          By: Parvesh at 2009-09-18 11:11:00