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



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. i m happy this programs thsk
View Tutorial          By: jai at 2011-05-09 14:20:35

2. Hi fiends,
your given approch is correct .

View Tutorial          By: Amit Kumar Singh at 2011-10-10 04:44:58

3. sir, i am completed MCA 2011 and i want to learn P
View Tutorial          By: vipin kumar at 2011-09-13 13:00:05

4. Log onto incoming mail server(POP3) - failed
View Tutorial          By: dragos at 2012-12-13 10:41:59

5. hi i am new to JSP wht is class.forname in the cod
View Tutorial          By: chanti at 2011-05-07 03:02:26

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

7. I am trying to execute the same code but still una
View Tutorial          By: Sona at 2015-06-11 18:35:13

8. we can create reference variable for an abstract c
View Tutorial          By: siva at 2012-08-30 06:03:50

9. at
OK
at+cmff=1
OK
at+

View Tutorial          By: shrinivas at 2009-03-07 23:16:51

10. nice one.. i lik dis page... very informative for
View Tutorial          By: lokesh at 2013-01-10 09:06:22