Redian新闻
>
请教一类 Game 的 reference
avatar
请教一类 Game 的 reference# Economics - 经济
n*d
1
This code works! Is it said we could not take address of register variable?
int main() {
register int a;
int *p;
a = 8;
p = &a;
cout << "a=" << *p <} ///:~
avatar
a*i
2
请教一这样一类game:
1. game 本身是infinately repeated;
2. player 是 short-sighted 的,譬如 maximize 一个 period 的 payoff ;
3. state of the stage game 是变化的,也就是说 state variable;
类似 Bequest Game,但是 Bequest Game player 是 maximize 两个 periods 的 payo
ff 的
有没有什么paper 用到我说的这个 framework,想参考一下,多谢!
avatar
t*t
3
7.1.1
3 A register specifier has the same semantics as an auto specifier
together with a hint to the implementation that the object so declared
will be heavily used. [Note: the hint can be ignored and in most
implementations it will be ignored if the address of the object is
taken. --end note]

【在 n**d 的大作中提到】
: This code works! Is it said we could not take address of register variable?
: int main() {
: register int a;
: int *p;
: a = 8;
: p = &a;
: cout << "a=" << *p <: } ///:~

avatar
n*d
4
Which book?
Thinking in C++ V3 one:
Register variables
...
There are restrictions to the use of register variables. You cannot take or
compute the address of a register variable. A
register variable can be declared only within a block (you cannot have
global or static register variables). You can, however, use a register
variable as a formal argument in a function (i.e., in the argument list).

【在 t****t 的大作中提到】
: 7.1.1
: 3 A register specifier has the same semantics as an auto specifier
: together with a hint to the implementation that the object so declared
: will be heavily used. [Note: the hint can be ignored and in most
: implementations it will be ignored if the address of the object is
: taken. --end note]

avatar
t*t
5
"you can not take the address of a register variable" means if you do, then
it is no longer a register variable
my quote is from the c++ standard, if any other book is against it, the book
must be not precise or could be even wrong

or

【在 n**d 的大作中提到】
: Which book?
: Thinking in C++ V3 one:
: Register variables
: ...
: There are restrictions to the use of register variables. You cannot take or
: compute the address of a register variable. A
: register variable can be declared only within a block (you cannot have
: global or static register variables). You can, however, use a register
: variable as a formal argument in a function (i.e., in the argument list).

avatar
n*d
6
why not directly say the book is wrong?

then
book

【在 t****t 的大作中提到】
: "you can not take the address of a register variable" means if you do, then
: it is no longer a register variable
: my quote is from the c++ standard, if any other book is against it, the book
: must be not precise or could be even wrong
:
: or

avatar
t*t
7
because it is not wrong..."can not" itself is not a precise word, it doesn't
say if you do it, what will happen. for a book, it is ok to say that.

【在 n**d 的大作中提到】
: why not directly say the book is wrong?
:
: then
: book

avatar
n*d
8
political answer.

't

【在 t****t 的大作中提到】
: because it is not wrong..."can not" itself is not a precise word, it doesn't
: say if you do it, what will happen. for a book, it is ok to say that.

avatar
t*t
9
what answer do you want?
why do i meet so many egghead today?

【在 n**d 的大作中提到】
: political answer.
:
: 't

avatar
n*d
10
You do answer the question very well. Thanks! We have different opinion to
the words from TIC which is misleading readers.

【在 t****t 的大作中提到】
: what answer do you want?
: why do i meet so many egghead today?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。