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. nice
View Tutorial          By: udhay at 2011-04-01 02:48:25

2. You are so great at helping people. ;0
View Tutorial          By: Aaton at 2015-04-24 14:06:57

3. nice and simple information...............
View Tutorial          By: sengadu at 2010-07-24 07:43:29

4. Thanks for the tutorial. I want to create a catalo
View Tutorial          By: Lue at 2012-07-09 07:00:08

5. Nice article .... Thank you...
View Tutorial          By: viswa at 2012-06-16 17:21:59

6. Hello sir pls send me
com.sun.speech.freet

View Tutorial          By: nikunj at 2011-08-19 06:55:37

7. hi,i am new in java..plz send me java programmes i
View Tutorial          By: dinesh at 2012-12-30 15:58:31

8. pls give me example of stack class with postfix me
View Tutorial          By: uchiha at 2011-09-16 04:02:57

9. Above explanation is given in complete reference j
View Tutorial          By: Pankaj at 2013-09-14 05:48:47

10. How can I save the canvas edited by the user from
View Tutorial          By: pavan at 2014-10-14 08:26:55