- ฟังก์ชั่นพวกนี้อยู่ใน stdlib.h
int atoi (const char *strNumber ) ;
/ / array to interger เปลี่ยนอักษรให้เป็น intlong atol (const char *strNumber ) ;
/ / array to interger เปลี่ยนอักษรให้เป็น longlong long atoll (const char *strNumber ) ;
/ / array to interger เปลี่ยนอักษรให้เป็น long longfloat atof (const char *strNumber);
/ / array to float เปลี่ยนอักษรให้เป็น float
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
printf("%d\n" , atoi("34")+1); | |
printf("%ld\n" , atol("34")+1); | |
printf("%lld\n" , atoll("34")+1); | |
printf("%f\n" , atof("35.345")); | |
return 0; | |
} |