使用eclipse编译错误
在下面的头文件中,我声明了一些函数:
#ifndef _MY_INT_FUNCTIONS_H_
#define _MY_INT_FUNCTIONS_H_
int intFcn (const void *key, size_t table_size);
void intPrint (const void *key);
int intCompare (const void *key1, const void *key2);
#endif // _MY_INT_FUNCTIONS_H_
但我收到一个编译错误:
“在‘size_t’之前预期有声明说明符或‘...’”
关于 int intFcn 函数,
。我使用 eclipse INDIGO 版本。
帮助任何人吗?
In the following header file i declared some functions:
#ifndef _MY_INT_FUNCTIONS_H_
#define _MY_INT_FUNCTIONS_H_
int intFcn (const void *key, size_t table_size);
void intPrint (const void *key);
int intCompare (const void *key1, const void *key2);
#endif // _MY_INT_FUNCTIONS_H_
but i get a compilation error saying:
"expected declaration specifiers or ‘...’ before ‘size_t’"
regarding the int intFcn function.
im using eclipse INDIGO version.
help anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

在 C++ 中,
size_t
在std
命名空间的
标头中声明。在 C 中(以及 C++ 中),它在
中声明:In C++
size_t
is declared in the<cstddef>
header in thestd
namespace.In C (and in C++ too), it's declared in
<stddef.h>
: