由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - What does int & mean? C/C++ question
相关主题
请教 C++的一个困惑 (operator delete)C++ Q93 - Q95 (转载)
C++ Q87: What is wrong with this swap function? (转载)int F::*x = &F::x是什么意思?
C++class指针转换c++ 里用到pointer 的地方我们尽可能用smart pointer吗?
这个function pointer最后的那个int是什么意思?不如各位高手挑个专题讲讲C++11吧
Why do I need to use "plain" pointer?Go adopts JavaScript’s idea of semicolon insertion
is smart_ptr really that good?pointer to function
pointer overflow听说pointer to member function只支持最多128个virtual functi
C++ Q05: pointer to constant variable一个nested class的问题
相关话题的讨论汇总
话题: foo话题: int话题: what话题: c++话题: does
进入Programming版参与讨论
1 (共1页)
A******g
发帖数: 612
1
A C/C++ question, I know
int* foo(void) foo
will return a pointer to int type
how about
int &foo(void)
what does it return?
Thank a lot!
N***m
发帖数: 4460
2
reference to int?瞎猜得,哈哈

【在 A******g 的大作中提到】
: A C/C++ question, I know
: int* foo(void) foo
: will return a pointer to int type
: how about
: int &foo(void)
: what does it return?
: Thank a lot!

g*********s
发帖数: 1782
3

not verifying its correctness. but if it's right, what does this line
mean?

【在 A******g 的大作中提到】
: A C/C++ question, I know
: int* foo(void) foo
: will return a pointer to int type
: how about
: int &foo(void)
: what does it return?
: Thank a lot!

N***m
发帖数: 4460
4
I guess he means int (*foo)(void)=foo;

【在 g*********s 的大作中提到】
:
: not verifying its correctness. but if it's right, what does this line
: mean?

g*********s
发帖数: 1782
5
self-assignment?

【在 N***m 的大作中提到】
: I guess he means int (*foo)(void)=foo;
N***m
发帖数: 4460
6
well, it is sth like:
int foo()
{
return 1;
}
int main()
{
int (*foo)(void)=::foo;
foo();
}

【在 g*********s 的大作中提到】
: self-assignment?
g*********s
发帖数: 1782
7
i turn on shadow warning and always avoid such code.

【在 N***m 的大作中提到】
: well, it is sth like:
: int foo()
: {
: return 1;
: }
: int main()
: {
: int (*foo)(void)=::foo;
: foo();
: }

N***m
发帖数: 4460
8
that's for sure. the demo code is to just try to figure out what lz means.

【在 g*********s 的大作中提到】
: i turn on shadow warning and always avoid such code.
1 (共1页)
进入Programming版参与讨论
相关主题
一个nested class的问题Why do I need to use "plain" pointer?
One question about Void pointeris smart_ptr really that good?
Why this is a dangling pointerpointer overflow
两个process重复了,哪里错了C++ Q05: pointer to constant variable
请教 C++的一个困惑 (operator delete)C++ Q93 - Q95 (转载)
C++ Q87: What is wrong with this swap function? (转载)int F::*x = &F::x是什么意思?
C++class指针转换c++ 里用到pointer 的地方我们尽可能用smart pointer吗?
这个function pointer最后的那个int是什么意思?不如各位高手挑个专题讲讲C++11吧
相关话题的讨论汇总
话题: foo话题: int话题: what话题: c++话题: does