|
Technical Interview Questions
.Net Interview Questions
C++ Interview Questions
Unix Interview Questions
.........More
Download e-Books
C Interview Questions e-book
Aptitude Interview Questions
C/C++ Aptitude Questions
C Aptitude Questions
.........More
Online Quiz
C
Online Quiz
C++
Online Quiz
.........More
|
|
Home >
C Interview Questions >
How can I convert a string to a number?
The standard C library provides several functions for converting strings
to numbers of all formats (integers, longs, floats, and so on) and vice
versa.
The following functions can be used to convert strings to numbers:
Function Name Purpose
atof() Converts a string to a double-precision floating-point value.
atoi() Converts a string to an integer.
atol() Converts a string to a long integer.
strtod() Converts a string to a double-precision floating-point value
and reports any leftover numbers that could not be converted.
strtol() Converts a string to a long integer and reports any leftover
numbers that could not be converted.
strtoul() Converts a string to an unsigned long integer and reports any
leftover numbers that could not be converted.
Have a Question ?
post your questions here. It
will be answered as soon as possible.
|