Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "string" abbreviated into "a" in standard C library function names?

Tags:

c

Standard C utility library stdlib.h has these function names:

(String as 'a'):

  • atof
  • atoi
  • itoa

(String as 'str'):

  • strtoul
  • strtol
  • strtod

Why is a string sometimes called an "a" and sometimes called an "str"?


1 Answers

a stands for ASCII, so in atoi it is ASCII to integer. See here. The ato family of functions have been deprecated by str functions.

like image 95
perreal Avatar answered Sep 13 '25 22:09

perreal