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 got an error while executing :

j

View Tutorial          By: Hi, at 2009-07-06 01:09:35

2. can u be more specific like put up some more headi
View Tutorial          By: Jass at 2012-10-29 03:51:29

3. Article from Java Complete Reference
View Tutorial          By: venkatesh at 2013-06-04 01:29:02

4. thank for the sharing.
View Tutorial          By: likelove at 2014-11-22 12:41:58

5. int n = 0;
for (int m = 0; m < 5; m++) {

View Tutorial          By: max at 2011-05-26 09:41:26

6. Simply explained theory.......
Thanx......!

View Tutorial          By: Priya at 2013-03-03 14:42:05

7. when i use this, the textarea automatically create
View Tutorial          By: gary at 2011-06-08 07:14:09

8. This is the helpful Site for beginner....!!!!!!!!!
View Tutorial          By: Anup at 2013-07-26 13:40:49

9. Highly appreciatable.Excellent Docs.
View Tutorial          By: Debi P Naik at 2010-05-04 05:55:45

10. which Iden WebJal do i need to load up my music MI
View Tutorial          By: phil at 2007-10-18 17:51:19