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. Very useful. Thank you. Would be interesting to kn
View Tutorial          By: Sergei at 2009-02-07 19:18:46

2. I think u've done well, just that more examples wi
View Tutorial          By: Mac at 2011-01-23 10:22:10

3. This tutorial is very good. Actually I have been s
View Tutorial          By: farhaan at 2008-03-20 15:22:13

4. Thank you sir.
View Tutorial          By: Balan at 2008-09-02 22:16:56

5. can help me for program in java Tomorrow I have ex
View Tutorial          By: blasm at 2013-06-21 06:59:41

6. the example program that given above for recursion
View Tutorial          By: bharathi at 2012-07-17 09:31:14

7. nice one
View Tutorial          By: sarvesh at 2015-03-12 05:16:10

8. great explanations.. some important words are miss
View Tutorial          By: Joshua Paul at 2015-04-14 03:43:44

9. Hi, this was useful. how can integrate j2me progra
View Tutorial          By: karthik at 2013-01-23 10:02:02

10. Hi
I can compile it
root$ javac -cp

View Tutorial          By: Tebogo Modiselle at 2014-10-31 08:47:09