N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

strtol

Format
#include <string.h>
long strtol (const char *string, char **endptr, int base)


Arguments
  • string is the character string to be converted
  • endptr is the pointer to a pointer to an unrecognizable character string
  • base is the radix (for bases from 2 to 36); if 0 is specified as the radix, the actual radix is obtained by using the first one or two characters of the string (see below)
Return Value
The converted numeric long value of the character string

What This Function Does
It converts a specified character string to a numeric value with a long type by parsing the string using this format:

[whitespace][{sign}][{0}][{x|X}][digits]

Where:
  • whitespace consists of spaces, NULL characters, or tab characters
  • sign is + (note that - is considered to be an unrecognizable character)
  • [{0}][{x|X}] is an optional radix specification code for octal (0 only) or hex (0 and (x or X))
  • digits consists of a string of more than one numeric characters
If 0 is specified as the radix base, the radix is interpreted as follows:
  • If the first character of the string is '0' and the second character is not 'x' or 'X', the radix is 8 (it is an octal number)
  • If the first character of the string is '0' and the second character is 'x' or 'X', the radix is 16 (it is a hexadecimal number)
  • If the first character of the string is '1' to '9', the radix is 10 (it is a decimal number)
Conversion is terminated when an unrecognizable character appears as a part of the number. If endptr is not NULL, it points to *endptr which points to the unrecognizable character that terminated the conversion.

Note
This standard function comes with NuSystem.


Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998