目前位置: VCer资源中心 >>> VCer代码 >>> C++/MFC基础

[本帖已阅读1116次 分值80 回复3次] 张贴资源 发回信箱 控制面板

简单的错误

提供者:study 张贴时间:2007-07-27 15:42:04.0 出处:vcer.net 作者:vcstudy

简单的错误(2007-07-27 15:42:04.0)


vcstudy


 
级别: VCer小兵
头衔: VCer会员

经验: 3
作品: 0
分会: 华北分会
注册: 2007-07-27 15:38:20.0
登录: 2007-09-03 10:44:22.0

#include "sting.h"

#include "stdafx.h"

#include <stdio.h>

void main( void )

{

  char string[80];

  strcpy( string, "Hello world from " );

  strcat( string, "strcpy " );

  strcat( string, "and " );

  strcat( string, "strcat!" );

  printf( "String = %s\n", string );

}

编译后出现:

E:\vcprogram\test1\test1.cpp(11) : error C2065: ’strcpy’ : undeclared identifier
      E:\vcprogram\test1\test1.cpp(12) : error C2065: ’strcat’ : undeclared identifier

注:转载文章需注明来源:VCer.net 文章地址:http://vcer.net/1185522124468.html

  如果你觉得VCer.net不错,而且你愿意为VCer.net捐赠一元钱,那么点击后面的捐赠按钮吧:) vcer.net捐赠

[回复该贴] [加入个人书签]
[投票结果]

A: 评分 10 0% (0 票)
B: 评分 5 0% (0 票)
C: 评分 0 0% (0 票)
D: 评分 -5 0% (0 票)
E: 评分 -10 0% (0 票)

 


re:简单的错误

你的#include"string"写错了你写成了#include"sting"

并且这个也错了#include"stdafx"没这个文件

kuxiaohua 于 2008-12-02 22:15:15.0 编辑 [回复该贴]

re:简单的错误

是不是定义那行错了啊

#include '' string.h''

 

scvdl2 于 2008-12-01 00:23:14.0 编辑 [回复该贴]

re:简单的错误

#include "sting.h" 应在 #include "stdafx.h" 的后面,同时你的#include "sting.h" 里的sting.h写错了,应为string.h

AMON2008 于 2008-11-03 20:06:03.0 编辑 [回复该贴]