September 2000
Intermediate to advanced
624 pages
14h 32m
English
These are the simplest functions for a C programmer to use, because they require no preparation or subsequent tests for conversion errors. With the exception of atof(3) on some UNIX platforms, the entire issue of conversion errors is ignored. For this reason, they are frequently not the best choice of conversion functions available.
Before the alternatives are explored, let's examine these traditional functions more closely.
The functions atoi(3) and atol(3) have the following synopsis:
#include <stdlib.h> int atoi(const char *nptr); long atol(const char *nptr);
These functions simply take the starting address of a C string and return the result as an int or a long
Read now
Unlock full access