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. Hi Shiva,
Comparator interface is used to o

View Tutorial          By: Srinath at 2015-04-19 08:23:20

2. HI,

can any one tell me small but s

View Tutorial          By: Amujuri Vivek at 2013-01-08 02:48:50

3. what if i use multiple switch statement, is it wor
View Tutorial          By: earl at 2012-01-29 04:10:25

4. i want some more info to make my final project.
View Tutorial          By: Arshid saeed at 2010-02-18 08:18:45

5. Code indentation would help!...
View Tutorial          By: James at 2011-06-30 04:54:51

6. To 15:
Sometimes it is useful to return the

View Tutorial          By: Anderson Goulart at 2010-08-24 19:15:14

7. we want to learn j2me
View Tutorial          By: vijay at 2010-09-27 02:34:59

8. Hi,

Can anyone suggest a GSM Modem

View Tutorial          By: Archna at 2009-11-06 03:23:14

9. How to do the following
Create a class With

View Tutorial          By: Anurag at 2014-01-03 10:14:45

10. thank u.....
View Tutorial          By: DiptaRanjan at 2013-02-02 14:56:45