void函数返回的问题

linlan999 2008-03-04 06:31:24
看到有如下的代码:
void FuncExamp(...)
{
...
}

......

Function()
{
......
if(!FuncExamp())
{}
.....
}

(!FuncExamp())
这个有什么作用啊?
...全文
122 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
billy1985 2008-03-04
  • 打赏
  • 举报
回复
应该是错误的 我也觉得是楼主看错了
canybox 2008-03-04
  • 打赏
  • 举报
回复
我觉得是你看错了,这个函数应该是重载,.

int FuncExamp(int i);
void FuncExamp();


int _tmain(int argc, _TCHAR* argv[])
{
if ( FuncExamp(1))
{
int c;
}

return 0;
}

int FuncExamp(int i)
{
i;
return 0;
}
void FuncExamp()
{
int i;
}
p0303230 2008-03-04
  • 打赏
  • 举报
回复
linux不懂
sepnic 2008-03-04
  • 打赏
  • 举报
回复
试下GCC?
visame 2008-03-04
  • 打赏
  • 举报
回复

/*
果然是错误的!
测试环境:
测试结果:
CSDN55.cpp: In function `int main()':
CSDN55.cpp:9: void value not ignored as it ought to be
CSDN55.cpp:9: in argument to unary !
*/
1 #include <iostream>
2 using namespace std;
3 void func()
4 {
5 }
6
7 int main()
8 {
9 if (!func())
10 {
11 cout<<"TEST"<<endl;
12 }
13 else
14 {
15 cout<<"Another TEST"<<endl;
16 }
17 }
linlan999 2008-03-04
  • 打赏
  • 举报
回复
但我的确在LINUX0.11版本的内核中看到了这样的代码!
Supper_Jerry 2008-03-04
  • 打赏
  • 举报
回复
(!FuncExamp())
这种用法是错误的。FuncExamp没有返回值。编译都过不去
prgmBaggio 2008-03-04
  • 打赏
  • 举报
回复
void FuncExamp(...)

void......
我也不知道。。。

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧