Thursday, November 25, 2010

The C++ Programming Language的問題

1.在Chap3 3.11 Advice p.66 裡 第七條
Using string rather than char*

請問即使我對char * 用了簡單的strcat strcpy這些library
會比string 還要來的慢嗎???

或者是可以說明在處理字串時(就ascii就好了)
什麼時候用string,when to use char*呢?



2.在10.2.8 Structurs and Classes的最後 p.235
他講了一句
allowing many access sepcifiers in a class is useful for
machine generated code.
就是他上面有講個例子 public,private可以一直加的

class Data4 {
public :
 ...
private :
 ...
public:
...
}

這裡的machine generated code是指什麼?
是某些tool產生出的c++ code還是compile完產生的code
(IR, assembly, or machine code)
為什麼會useful??



3. 在10.4.6.2 Member Constants p249
他說可以initialize a static integral constant member
為什麼只有int 可以 float那些為什麼不行呢???



4.在11.2.3 p265
第一段要結束時他說
it is not possible to define an operator function that
operates exclusively on pointers



5.Sec13.4 Using Template Arguments to Specify Policy
主要在講用Template class來specify operation(less,eq,..)

在p339 倒數第三段最後面 他說了
whereas inlining a call through a pointer to function
requires exceptional attention from a compiler
在這裡指的exceptional attention是指什麼呢?

寫C寫久了會很習慣用pointer to function
但想知道這裡不建議使用pfn的原因







6. Sec14.2 Grouping of Exceptions
第一段的第三行有說
the effect of a throw is to unwind the stack until a
suitable catch is found

他說的unwind是什麼意思呢
是指一般function return時stack會清掉的意思嗎?
(esp回到ebp)
如果是這樣的話
throw 出來的那個object(or pointer,reference)
他是存在哪裡的??
stack被清掉那exception應該也會被清吧???

10 comments:

Anonymous said...

Appreciate the recommendation. Let me try it out.
My page ; epl transfer news now

Anonymous said...

I think the admin of this web page is actually working hard in favor
of his site, because here every material is quality based information.
Feel free to surf my site - chelsea transfer news january 2013

Anonymous said...

I know this site offers quality dependent content and extra stuff, is there any other
site which presents such information in quality?
Here is my site ... real madrid transfer rumours

Anonymous said...

I know this if off topіc but I'm looking into starting my own weblog and was wondering what all is required to get set up? I'm asѕuming
haνing a blog like yours would cоst a ргetty penny?
I'm not very internet smart so I'm not 100% certain. Any rеcommenԁations оr adviсе would be gгeatly appreciated.
Thаnks

Alѕο vіѕit my page .
.. abrir cuenta facebook

Anonymous said...

Whoa! This blog looks juѕt lіκe my olԁ
one! It's on a completely different topic but it has pretty much the same page layout and design. Superb choice of colors!

My web-site; crear facebook gratis

Anonymous said...

I constantly spеnt my half an hоur tο read this wеblog's articles or reviews all the time along with a mug of coffee.

Also visit my webpage :: www.chemart.biz

Anonymous said...

Thank you for the good writeup. Ιt in fact ωas a amusement
account it. Look aԁvanced to far addeԁ agгеeable from yοu!

Bу the way, how coulԁ we communicаte?

Аlso visit my ωebsite facebook cuenta gratis

Anonymous said...

I аm really іmρreѕѕed wіth your writing skillѕ
anԁ alsо with thе layout on your ωeblog.
Is this a pаiԁ theme οr ԁid you customizе іt уourѕelf?
Anуway keeр up the nіce quаlity ωгiting, іt
іs rаre tо see a grеat blog like this one today.



My page facebook Cuenta gratis

Anonymous said...

Ηі, yeаh thіѕ ρiece of writing
iѕ truly nісе and I hаvе leaгned lot of thіngs from
іt on the topic of blоgging. thаnkѕ.


Feеl freе to viѕit mу ωеblog .
.. facebook cuenta gratis

Anonymous said...

You require to make sure that they are sterilized and you have ample bandage with you.
Follow this each day right up until the mole disappears.


Feel free to surf to my webpage ... where can you buy dermatend