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. great job
i seriously feel that this site i

View Tutorial          By: saurabh at 2012-01-17 05:28:32

2. could anyone run this program on Netbean? If there
View Tutorial          By: Wei Long at 2008-06-16 19:23:48

3. @ Qui:

You can set the CSS Style:
View Tutorial          By: hache at 2010-06-22 02:02:56

4. I have initialized a int array while declaring.
View Tutorial          By: Prashanth at 2011-09-15 11:16:40

5. Please help here...
I tried both 0300460423

View Tutorial          By: Zafar Iqbal at 2013-04-02 20:14:29

6. Dear Gurus, I have arrived at your site lloking f
View Tutorial          By: Fred Mah at 2012-09-22 07:40:27

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

8. Thanks!
Please point me to a site which di

View Tutorial          By: TERRY DEGLOW at 2012-01-29 16:04:41

9. hi....
i want to send sms to any mobile by

View Tutorial          By: prerna at 2010-07-09 20:15:48

10. what about the access modifiers, while talking abo
View Tutorial          By: Seetha at 2010-06-04 01:14:02