www.delorie.com/djgpp/doc/libc-2.01/libc_49.html   search  
Go to the first, previous, next, last section, table of contents.


atoi

Syntax

#include <stdlib.h>

int atoi(const char *string);

Description

Convert as much of the string as possible to an equivalent integer value.

This function is almost like (int)strtol(string, NULL, 10) (see section strtol).

Return Value

The equivalent value, or zero if the string does not represent a number.

Example

main(int argc, char **argv)
{
  int i = atoi(argv[1]);
  ...


Go to the first, previous, next, last section, table of contents.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 1997   by DJ Delorie     Updated Apr 1997  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)