Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » atol

atol

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

long atol(char s[]);

Description

Converts the string s to a LONG number. The number base is decimal. Starting with string 0x, base 16 is used. Leading blanks are not read.

Parameters

  • s: String to be converted.

Return Values

  • The converted number.
  • 0 will be returned if the string is no number.

Example

...
long z1;
long z2;
z1 = atol("200");
z2 = atol("0xFF");
...
Result:
z1 = 200, z2 = 255
ltoastrtolstrtoul