GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
ASTOI(3) Schily´s LIBRARY FUNCTIONS ASTOI(3)

astoi() - converts ASCII to integer

#include <schily/schily.h>

char *astoi(string,result)
	char *string; /* the string to convert */
	int *result; /* where to store the result */

astoi() converts the characters pointed to by string to an integer stored at result. It returns a pointer to the first character in the string that was not used for the conversion. If the entire string is to be used, it should point to a NULL character ('\0'). Leading spaces and tabs are skipped.

The ASCII string accepts a leading `+' or `-'. A leading zero in the string makes the number octal, while a leading 0x makes the number hexadecimal. Leading spaces and tabs are skipped.

Returns a pointer to the first unused character.

if (*astoi(string, &i) != '\0')
	error("Not a number %s\n", string);

astol(3)

Range errors are not checked. Conversion stops (and a pointer is returned) at the first non-numeric character other than the leading sign or 0x, as described above.
15. Juli 1988 Joerg Schilling

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.