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. tell me the new page create in java and attach wi
View Tutorial          By: muhammad nadeem at 2011-07-06 00:12:08

2. very cool you said it! many thanks it's really coo
View Tutorial          By: ArAsh at 2008-12-11 06:41:13

3. Can u tell me more about struts related to databas
View Tutorial          By: archana at 2010-09-15 04:38:54

4. This is totally great. Your explaination make me u
View Tutorial          By: Cipom at 2010-04-11 18:41:04

5. Simple and easy code..........
View Tutorial          By: mandalson at 2011-12-24 04:08:12

6. Hi, I am new to J2ME and just recently i created a
View Tutorial          By: andre at 2011-08-02 22:57:05

7. it is a big help for us , as a IT student that kn
View Tutorial          By: nelson kent recites at 2012-01-19 08:56:26

8. Its working ,,, gud stuff.
View Tutorial          By: Atul at 2011-07-21 10:34:44

9. hi ..

for second code which impleme

View Tutorial          By: Eng at 2009-02-21 03:53:29

10. Hi, you put a semicolon after "int main()&quo
View Tutorial          By: noel4037 at 2009-12-28 06:40:17