C语言字符串转数字示例:输入数字字符串并转换为数值输出
#include <stdio.h>
#include <stdlib.h>
int main() {
    char string[100];
    printf("Enter a string:");
    scanf("%s", string);
    
    int number = atoi(string);
    
    printf("digit=%d\n", number);
    
    return 0;
}
原文地址: https://www.cveoy.top/t/topic/n7W 著作权归作者所有。请勿转载和采集!