- 论坛徽章:
- 0
|
关于string.h和memory.h
Bjane Stoustrup支持大家的更加标准化的观点
大家赢了,我输了,谢谢大家对我的帮助
On 4/21/2012 7:02 AM, Chen Liangqiao wrote:
> Dear Sir,
>
> I thought i find another little bug in the example code today.
> in the subject "Initializer lists" , in the middle of the code:
>
> { {"Martin", "Ritchards"} {1982, 2003, 2007} },
>
> the comma(,) is missing at the end of "Ritchards"} ".
Thanks
>
> by the way, i want to ask a question about string.h and memory.h.
> If i wan to use memset() in my program, which header file shoule I
> include? string.h or memory.h?
string.h
> Someone told me that I should include string.h, but, my question is:
> why should I include a header file which is irrelative to the memory
> operation?
because that's where it is in ISO C and C++
> Why not include the memory.h directly?
because that's not where memset() is supposed to be (however logical it
may seem to put it there)
> In my opinion, It is more readability than string.h, for the programmer.
>
>
>
> -----Original Message----- From: Bjarne Stroustrup
> Sent: Monday, April 16, 2012 12:51 AM
> To: Chen Liangqiao
> Subject: Re: a little bug in C++11 FAQ
>
> On 4/15/2012 10:34 AM, Chen Liangqiao wrote:
>> Dear Sir,
>>
>> I found a little bug in the C++11 FAQ when i reviewed it.
>>
>> in the subject "noexcept-- preventing exception propagation", i guess
>> the semicolon( in the end of code line
>>
>> void do_f(vector<T>& v) noexcept(noexcept(f(v.at(0)))); // can thr
>>
>> is unnecessary.
>
> Corrct. Thank you.
>
>>
>> by the way, i have moved the C++11 FAQ Chinese to a new place,
>> because the original site is unstabitily. the new URL is
>>
>> http://chenlq.net/cpp11-faq-chs
>>
>> would you please change the url in your English FAQ? Thank you!
>
> I have updated my source, but it will take maybe a week before my
> correction will go "live".
>
>>
>>
>> 陈良乔
>>
>> 了解我更多:
>> http://chenlq.net
>> 时刻关注我:
>> http://t.sina.com.cn/chenliangqiao
>
|
|