函数“ atoi”的隐式声明?

问题描述

为什么我在“ atoi()”函数上出错?

#include <stdio.h>
#include <string.h>
int main()
{
    char s1[10],s2[10];
    int x=5,y=6,z;
    sprintf(s1,"%d",x);
    sprintf(s2,y);
    strcat(s1,s2);
     z = atoi(s1);
    printf("%d,%s",z,s1);
    return 0;
}

如上所述,它在atoi()函数上的抛出错误!

解决方法

TypeError: cannot convert the series to <class 'int'>

将修复它。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...