请问这里的undeclared identifier是什么意思呢?

来源:百度知道 编辑:UC知道 时间:2024/06/04 12:49:11
错误列表:
Compiling...
ceshi2.cpp
G:\pspdev\myproj\ceshi2\ceshi2.cpp(9) : error C2065: 'dayin' : undeclared identifier
执行 cl.exe 时出错.

ceshi2.exe - 1 error(s), 0 warning(s)
===========================================
ceshi2.cpp
===========================================
#include "Cpp1.cpp"
#include "stdafx.h"

int main(int argc, char* argv[])
{
printf("Hello World!\n");
dayin("123","123");
return 0;
}
============================================
Cpp1.cpp
============================================
#include "stdafx.h"
#include "ceshi2.cpp"
void dayin(char * str1,char*str2)
{
printf(str1,str2);
}
怎么声明

函数没有申明
而且两个文件不能互相包含

你只要把Cpp1.cpp
里的 #include "ceshi2.cpp" 删了 就行了

两个文件不能互相包含

两个文件不能这么相互包含的。

这个dayin标识符使用前没有被声明