我的頭文件中有一些錯誤,我不知道該如何解決,因爲我對C++相當陌生。C++頭文件 - 語法問題
這裏是頭文件的代碼:
#pragma once
typedef unsigned int uint;
class DCEncryption
{
public:
static char* manageData(char*, char*, uint);
private:
static int max(int, int);
static uint leftRotate(uint, int);
};
這裏是錯誤:
- dcencryption.h(12): error C2062: type 'int' unexpected
- dcencryption.h(12): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
- dcencryption.h(12): error C2760: syntax error : expected '{' not ';'
- dcencryption.h(13): error C2144: syntax error : 'uint' should be preceded by '}'
- dcencryption.h(13): error C2143: syntax error : missing ')' before ';'
- dcencryption.h(13): error C2059: syntax error : ')'
- dcencryption.h(13): error C2143: syntax error : missing ';' before ')'
- dcencryption.h(13): error C2238: unexpected token(s) preceding ';'
我相信在一些編譯器中,'uint'是'unsigned int'的保留關鍵字。我可能是錯的,但嘗試改變你的命名方案。 – Drise
@Drise - 聽起來不太可能,除非你記得事實上是C#。 –
@JirkaHanika無論如何,這似乎是某種宏觀或'#define'衝突。我仍然責備命名衝突。 – Drise