为什么会报错
我是按照答案打的但是报错了 我查了好久也不明白哪里有错#include<stdio.h>voiddollars( char *dest, char*src)
{
int len;
int i;
if (dest==NULL||src==NULL)
return;
*dest++='。
报错:9 16 C:\Users\user\Desktop\未命名1.cpp 'strlen' was not declared in this scope;
len=strlen(src);
if(len>=3)
{
for(i=len-2;i>0;)
{
*dest++=*src++;
if(--i>0&&i%3==0)
*dest++=',';
}
}
else *dest++='0';
*dest++=len<2?'0':*src++;
*dest++=len<2?'0':*src;
*dest=0;
} 。
报错:9 16 C:\Users\user\Desktop\未命名1.cpp 'strlen' was not declared in this scope 第9行是报错我放错位置了 抱歉! 用strlen需要头文件string.h BngThea 发表于 2017-12-24 10:52
用strlen需要头文件string.h
C:\Users\user\新建文件夹\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o) In function `main':
18 C:\crossdev\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt0_c.c undefined reference to `WinMain'
C:\Users\user\Desktop\collect2.exe ld returned 1 exit status sepulcher 发表于 2017-12-24 11:09
C:%users%user\新建文件夹\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-cr ...
加了头文件还是不对啊
sepulcher 发表于 2017-12-24 11:09
C:%users%user\新建文件夹\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-cr ...
没有main函数啊
页:
[1]