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. Thanks a lot. It solved my problem in a second.
View Tutorial          By: Suddy at 2010-03-25 14:56:10

2. Hi I need code examples J2ME for chating aplicatio
View Tutorial          By: agus at 2010-04-03 04:16:11

3. hi.....
if we have number of fieldsl ike na

View Tutorial          By: shailesh at 2011-12-15 07:10:34

4. i wish to get some example java programs to unders
View Tutorial          By: rebecca at 2010-01-09 03:14:42

5. Java s ssssss
View Tutorial          By: zoya at 2012-04-27 12:24:59

6. I need dumps for practice
View Tutorial          By: Sanket barge at 2011-06-17 10:05:16

7. hi Ashray P Shetty,
I want assistance in th

View Tutorial          By: Shabbir Manasawala at 2010-11-19 02:02:43

8. THIS IS VERY SIMPLE AND EXCELENT PROGRAM.THIS PROG
View Tutorial          By: CHIRANJEET at 2011-02-05 12:13:54

9. sorry guys: how can i retrieve a report or large t
View Tutorial          By: aidid at 2013-05-04 06:07:42

10. i was after a user interactive calendar where they
View Tutorial          By: Harry at 2011-11-17 09:01:07