执行 [英] Execution
问题描述
代码如下:
strncpy(temp_issue,& temp1 [13],4);
files.rec1.issue_rec [4] = atol(temp_issue);
cout<< files.rec1.issue_rec [4]<< endl;
执行时我得到以下内容。
0x0fd10
a内存地址无疑。
但是在执行以下操作时:
strncpy(temp_customer_code1,& temp1 [2],5);
files.rec1.customer_code [5] =''\''';
files.rec1.customer_code [5] = atol(temp_customer_code1);
cout<< files.rec1.customer_code [5]<< endl;
我得到一个明智的
98581.
我是否已经离开了界限。任何认为他们可以解决这个谜团的人请回复。真正的解决方案,因为公牛****
并没有让我到任何地方。
for the following code:
strncpy(temp_issue, &temp1[13], 4);
files.rec1.issue_rec[4] = atol(temp_issue);
cout<<files.rec1.issue_rec[4]<<endl;
on execution I get the following.
0x0fd10
a memory address no doubt.
but when doing the following:
strncpy(temp_customer_code1, &temp1[2], 5);
files.rec1.customer_code[5] = ''\0'';
files.rec1.customer_code[5] = atol(temp_customer_code1);
cout<< files.rec1.customer_code[5] <<endl;
I get a sensible
98581.
Have I gone out of bounds at all. Anyone who thinks they can solve
this mystery please respond. Real solutions please, as Bull****
doesn''t get me anywhere.
推荐答案
" muser" ; < CH ********** @ hotmail.com>写了......
"muser" <ch**********@hotmail.com> wrote...
以获取以下代码:
strncpy(temp_issue,& temp1 [13],4);
files.rec1.issue_rec [4 ] = atol(temp_issue);
cout<< files.rec1.issue_rec [4]<< endl;
执行时我得到以下内容。
0x0fd10
内存地址毋庸置疑。
真的吗?对我来说代码没有编译。也许你忘了提到它只是一个片段。
未使用的符号
被声明。所以,我对这个世界都有所怀疑。
BTW,0x0fd10是64784十进制。看起来足够明智。
但是在执行以下操作时:
strncpy(temp_customer_code1,& temp1 [2],5);
files.rec1.customer_code [ 5] =''\''';
files.rec1.customer_code [5] = atol(temp_customer_code1);
cout<< files.rec1.customer_code [5]<< endl;
我得到一个明智的
98581.
"明智"?如果它被打印为''0x018115''(相同的
值,只有十六进制)?
我是否已经超出界限。任何认为可以解决这个谜的人都请回复。真正的解决方案,因为Bull ****
并没有让我到任何地方。
for the following code:
strncpy(temp_issue, &temp1[13], 4);
files.rec1.issue_rec[4] = atol(temp_issue);
cout<<files.rec1.issue_rec[4]<<endl;
on execution I get the following.
0x0fd10
a memory address no doubt.
Really? For me that code doesn''t compile. Perhaps you forgot
to mention that it''s just a fragment. Neither of used symbols
is declared. So, I have all doubts in the world.
BTW, 0x0fd10 is 64784 decimal. Seems sensible enough.
but when doing the following:
strncpy(temp_customer_code1, &temp1[2], 5);
files.rec1.customer_code[5] = ''\0'';
files.rec1.customer_code[5] = atol(temp_customer_code1);
cout<< files.rec1.customer_code[5] <<endl;
I get a sensible
98581.
"Sensible"? And if it were printed as ''0x018115'' (the same
value, only in hex)?
Have I gone out of bounds at all. Anyone who thinks they can solve
this mystery please respond. Real solutions please, as Bull****
doesn''t get me anywhere.
真正的解决方案是什么?一些代码的两个片段,没有类
定义,没有函数定义......你怎么期望我们
来帮助你?如果这是你之前讨论过的一些早期讨论的延续
你为什么在同一个帖子中发布了一条新消息而不是
?
发布完整代码。阅读常见问题5.8。
Victor
Real solutions to what? Two fragments of some code, no class
definitions, no function definitions... How do you expect us
to help you? If that''s a continuation of some earlier discussion
you had with the group, why did you post a new message instead of
continuing in the same thread?
Post complete code. Read FAQ 5.8.
Victor
2003年7月29日13:07:51 -0700, ch ********** @ hotmail.com (muser)写道:
On 29 Jul 2003 13:07:51 -0700, ch**********@hotmail.com (muser) wrote:
我是否已经离开了界限。
Have I gone out of bounds at all.
我们怎么可能回答这个问题呢?
< / dib>
John Dibling
Witty banter省略了保护
How can we possibly answer this question?
</dib>
John Dibling
Witty banter omitted for your protection
muser写道:
muser wrote:
我是否已经离开了界限。任何认为可以解决这个谜的人都请回复。真正的解决方案,因为Bull ****
并没有让我到任何地方。
Have I gone out of bounds at all. Anyone who thinks they can solve
this mystery please respond. Real solutions please, as Bull****
doesn''t get me anywhere.
请问真正的问题,因为Bull ****没有你找不到任何地方。
Ask real questions please, as Bull**** doesn''t get you anywhere.
这篇关于执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!