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. My code runs smoothly. I have taken some steps for
View Tutorial          By: Amit Shrivastava at 2015-01-25 13:48:46

2. Isn't the Vector class deprecated now? I think Arr
View Tutorial          By: Brent at 2013-07-07 06:10:01

3. Finally a tutorial that clearly explains why Hasht
View Tutorial          By: Lisa Ander at 2011-10-27 20:33:15

4. pls send simple to hard j2me coding
View Tutorial          By: Seenu at 2008-10-29 15:19:03

5. this tutorial example of inheritence is taken from
View Tutorial          By: vinod kumar gaur at 2011-07-17 23:18:00

6. Thank you!!
View Tutorial          By: Diego at 2015-07-16 21:11:58

7. This is probably a good java tutorial but it made
View Tutorial          By: lol at 2012-09-15 21:20:09

8. As C does not support Function Overloading, there
View Tutorial          By: N at 2013-03-06 00:27:14

9. Thanks a lot.. it made my concepts of memmove,mems
View Tutorial          By: Rimmi Jain at 2009-07-23 06:42:01

10. #include<stdio.h>
void main(){

View Tutorial          By: niru at 2012-07-21 07:26:27