“{”令牌错误前预期的非限定id
expected unqualified-id before ‘{’ token error
#include <iostream>
#include "proj1.h"
using namespace std;
//Deciphers a message. cip[] is a char array containing a Cipher message
//as a null-term.
void Decipher(char Cip[], char key);
{
char intCip[];
char intMessage[];
char cipher[];
int intKey = key - 'A';
for( int i = 0; i < strlen(Cip); i++)
{
if(Cip[i] >= 'A' && Cip[i] <= 'Z')
{
intCip[i] = key - Cip[i];
}
}
for( int i = 0; i < strlen(Cip); i++)
{
Cip[i] = (intCip[i] + (intKey % 26));
}
}
char SolveCipher(const char Cip[], char dec[]);
{
return 0;
}
int main()
{
Decipher (ciper[0], 'R');
return 0;
}
我得到这个错误信息时,我试图使。exe
g++ -Wall proj1.cpp -o program
proj1.cpp:8: error: expected unqualified-id before ‘{’ token
make: *** [program] Error 1
这是什么意思?我看不出在'{'之前我需要什么,因为它开始了函数定义。
有;
void Decipher(char Cip[], char key); // notice the semicolon
表示函数原型声明。要定义一个函数,需要删除分号
去掉void Decipher(char Cip[], char key)
后面的分号
相关文章:
- C++:"("令牌"之前有预期的非限定 id 指向类中成员函数的指针
- 错误:令牌 { '{' 之前应存在非限定 ID
- 令牌 C++ 错误之前'['非限定 ID
- 修复令牌错误之前';'预期的非限定 ID
- C 错误:令牌之前'['预期为非限定 id
- "["令牌和 + 之前应为非限定 ID
- 屏幕显示脚本中'.'令牌之前的预期非限定 id
- “OR”令牌之前的预期非限定 ID
- 声明中的限定 ID 在"="令牌/对象计数器变量之前
- 需要调试"在')'令牌之前预期的非限定id",第一次使用c ++的用户
- 在"." 令牌之前应为非限定 ID(C++ 错误)
- 在“.”令牌之前应为非限定 ID
- 令牌之前应'{'非限定 ID
- 函数概率:令牌之前'['预期的非限定 id
- 预期在令牌之前的未合格ID
- 错误:预期的非限定 ID befo 重新'{'令牌
- Arduino 错误在令牌之前预期为非限定 id '/'
- 错误:在 Arduino 中'{'令牌之前预期未限定 ID
- 令牌之前')'预期的非限定 id?
- 令牌之前应为非限定 ID ')'