作者查詢 / hilorrk

總覽項目: 發文 | 留言 | 暱稱
作者 hilorrk 在 PTT [ C_and_CPP ] 看板的留言(推文), 共1004則
限定看板:C_and_CPP
[問題] new int array的初始值
[ C_and_CPP ]35 留言, 推噓總分: +5
作者: jehovah - 發表於 2010/09/06 00:22(15年前)
6Fhilorrk:primitive type加()有定義會初始為零吧? 沒有的話是未知數09/06 00:58
7Fhilorrk:所以才能讓template<typename T> foo(T x = T())這種用法09/06 00:59
8Fhilorrk:也適用於primitive type09/06 00:59
12Fhilorrk:我在gcc 4.5中測是會全部初始為零的說...09/06 01:06
13Fhilorrk:你用的compiler是?09/06 01:09
15Fhilorrk:在gcc全零純粹是運氣問題吧~剛好裡面的垃圾是零而已XD09/06 01:14
16Fhilorrk:我用char、int、long、float、double都測過 沒加是垃圾值09/06 01:15
17Fhilorrk:加了全變成零...in gcc09/06 01:15
20Fhilorrk:我加上-ansi -pedantic -Wall也都沒有任何error/warning09/06 01:46
21Fhilorrk:而且行為也一樣... 所以我以為是標準規定的XD09/06 01:46
22Fhilorrk:剛看了一下規格書 應該是有這種形式吧?09/06 02:19
23Fhilorrk:new-expression -> new new-type-id new-initializer09/06 02:20
24Fhilorrk:new type-specifier new-declarator new-initializer09/06 02:21
25Fhilorrk:->new type-specifier direct-new-declarator new-initial09/06 02:23
26Fhilorrk:izer09/06 02:23
27Fhilorrk:->new type-specifier [expression]()09/06 02:23
29Fhilorrk:嗯嗯 再加上15條的value-initialized09/06 02:32
30Fhilorrk:array的value-initialized是對每個element做value-initial09/06 02:32
31Fhilorrk:而scalar type的value-initialize= zero-initialize=009/06 02:33
Re: [問題] 指標常數的問題
[ C_and_CPP ]4 留言, 推噓總分: +4
作者: LPH66 - 發表於 2010/09/05 19:45(15年前)
4Fhilorrk:推~09/06 01:27
[問題] 指標常數的問題
[ C_and_CPP ]9 留言, 推噓總分: +3
作者: guanrulee - 發表於 2010/09/05 18:03(15年前)
8Fhilorrk:歡迎看看"pointer to array請教"討論串XD09/05 18:50
Re: [問題] typedef與defind的問題
[ C_and_CPP ]6 留言, 推噓總分: +2
作者: elefant - 發表於 2010/09/04 18:53(15年前)
1Fhilorrk:還有 const INT_PTR 前者為 int const* 後者為 int *const09/04 19:05
[問題] 在Xcode上寫C++是否和在Dev上寫不同?
[ C_and_CPP ]17 留言, 推噓總分: +2
作者: yin0416 - 發表於 2010/09/04 16:21(15年前)
1Fhilorrk:apple shell沒有PAUSE這個command...09/04 16:23
4Fhilorrk:書上有這種例子的確不當 另外原因可以在版上/pause09/04 16:26
7Fhilorrk:樓上好人超09/04 16:33
9Fhilorrk:基本上不用 ANSI-C是不分平台的..不過書有好壞09/04 16:37
12Fhilorrk:你可以/書 看看版上前輩們推諫的好書09/04 16:38
[問題] Eclipse C++ consle無法顯示!?
[ C_and_CPP ]11 留言, 推噓總分: +4
作者: cooljony0109 - 發表於 2010/09/02 00:25(15年前)
2Fhilorrk:其實有Eclipse版...09/02 00:47
[問題] 指標問題
[ C_and_CPP ]39 留言, 推噓總分: +5
作者: Lattewang - 發表於 2010/09/02 00:08(15年前)
30Fhilorrk:回QQ29 const在純C是external linkage..這樣寫會redefine09/02 01:27
34Fhilorrk:不過C字串使用internal linkage也導致不能用作nontype09/02 01:50
35Fhilorrk:template param的arg...不知C++0x有沒有改進這點@@?09/02 01:50
[問題] 請問,有辦法用c語言實作物件導向嗎
[ C_and_CPP ]23 留言, 推噓總分: +4
作者: stature - 發表於 2010/09/01 21:17(15年前)
6Fhilorrk:google Object-oriented Programming with ANSI-C...XD09/01 22:36
Re: [問題] cstdlib相關問題
[ C_and_CPP ]46 留言, 推噓總分: +16
作者: james732 - 發表於 2010/09/01 19:15(15年前)
3Fhilorrk:好人超你是個超好人09/01 20:23
9Fhilorrk:extern template不是C++0x才加入標準的嗎?09/01 20:35
13Fhilorrk:是這樣說沒錯..XD 如果是說export...有等於沒有= =||09/01 20:38
[問題] 格式顯示的修飾子
[ C_and_CPP ]6 留言, 推噓總分: +1
作者: lacrimosacat - 發表於 2010/08/31 22:27(15年前)
1Fhilorrk:代入後面的arg設定格式08/31 22:42
5Fhilorrk:等於"%3d\n%3d\n%3d\n",3,3000,3000009/01 02:05
6Fhilorrk:等於把3代入*..跟把3000代入%d差不多意思09/01 02:05