请问一下在VC6.0编译错在哪里?

[复制链接]
查看11 | 回复2 | 2011-4-24 10:04:15 | 显示全部楼层 |阅读模式
#include
#include
#include
int main()
{
using namespace std;
char charr1[20];

char charr2[20]="jaguar";
string str1;
string str2="panther";
str1=str2;
strcpt(charr1,charr2);
str1+=" paste";
strcat(charr1," juice");
int len1=str1.size();
int len2=strlen(charr1);
cout<<"The string "<<str1<<" contains "
<<len1<<" character.\n";
cout<<"The string "<<charr1<<" contains "
<<len2<<" characters.\n";
return 0;
}
--------------------Configuration: 1 - Win32 Debug--------------------
Compiling...
1.cpp
C:\Documents and Settings\admin\桌面\1.cpp(12) : error C2065: 'strcpt' : undeclared identifier
Error executing cl.exe.
1.exe - 1 error(s), 0 warning(s)

回复

使用道具 举报

千问 | 2011-4-24 10:04:15 | 显示全部楼层
把strcpt改成strcpy就行啦
回复

使用道具 举报

千问 | 2011-4-24 10:04:15 | 显示全部楼层
把strcpt改成strcpy
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行