vc C2085 not in formal parameter list
来源:百度文库 编辑:神马文学网 时间:2024/04/20 15:55:28
刚才帮人解决了一个vc编程的疑难杂症.确实值得记录一下.这个错很有味道.
C2085 not in formal parameter list错误号C2085,意思是出错变量不在形参列表中.行参列表,指的是函数声明或者定义的形参声明部分.出这个错,往往是因为出错位置或者此位置之前的一个函数的声明或者定义有语法错误.这次解决的这个疑难杂症是这样的.
涉及三个文件.
第一个文件, A.c
#include "B.h"
#include "C.h"
第二个文件, B.h
int function(int a,int b)
第三个文件, C.h
int x;
编译A.c,就会有错误提示C2085,在C.h的int x;这一行出错.
C.h(1) : error C2085: 'x' : not in formal parameter list
提示x变量没有在形参列表中.
于是打开C.h,看了老半天,觉得int x;这行实在不该有错.错误可能并不在C.h,而是在它之前的那个头文件,B.h中. 打开B.h,发现最后一行的这个函数声明,缺少了一个分号,于是编译器在编译A.c的时候,将B.h和C.h依次展开,便将C.h中的x变量当作了function函数的形参,进而报错.
vc C2085 not in formal parameter list
Memorize a List in Order
is not in sudoer file
In Defense of Not-Invented-Here Syndrome
AVI DVC not playing in Media Player
Error: Content is not allowed in prolog
T恤文化:Not In Your Face
I DO NOT LOOK THEM IN EYES
SQL中IN,NOT IN,EXISTS,NOT EXISTS的用法和差别
TechSpin: VC Activity in Europe Bounce Back
oracle里not exists和not in 性能测试_sailorhu的记事本
Write operations are not allowed in read-only...
Biofuels in Brazil | Lean, green and not mean...
China In L. America: Partner, Not Threat (So Far)
Tesco: What Not to Do in a Down Economy
China not to let yuan gain in short term: experts
China In L. America: Partner, Not Threat (So Far)
Better not to get married in 'Year of Tiger'
main.o: could not read symbols: File in wrong format
Not In Your Face 揭示个性的背影摄影
Russia not to drop security initiative in Europe: Medvedev
Not In Your Face 揭示个性的背影摄影
Write operations are not allowed in read-only mode
Manage for Profit, Not for Market Share: A Guide to Greater Profits in Highly Competitive Markets