[問題] 關於一個建構子問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
在看c++ how to program 第11.9的時候看到了一個建構子
Array::Array( const Array &arrayToCopy )
: size( arrayToCopy.size )
{
ptr = new int[ size ]; // create space for pointer-based array
for ( int i = 0; i < size; i++ )
ptr[ i ] = arrayToCopy.ptr[ i ]; // copy into object
} // end Array copy constructor
請問他的: size( arrayToCopy.size )的語法是什麼?
我能夠用什麼關鍵字查到呢?
麻煩大家了
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
http://nopaste.info/3b8e6f97b3.html
http://nopaste.info/c10bbda020.html
http://nopaste.info/24180f0fb1.html
問題段落在第二個程式碼的第22行
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.125.20.92
推
06/06 00:14, , 1F
06/06 00:14, 1F
※ 編輯: diabloevagto 來自: 140.125.20.92 (06/06 00:18)
推
06/06 00:17, , 2F
06/06 00:17, 2F
→
06/06 00:32, , 3F
06/06 00:32, 3F
→
06/06 00:34, , 4F
06/06 00:34, 4F
→
06/06 00:42, , 5F
06/06 00:42, 5F
→
06/06 00:42, , 6F
06/06 00:42, 6F
→
06/06 00:48, , 7F
06/06 00:48, 7F
→
06/06 00:48, , 8F
06/06 00:48, 8F
→
06/06 00:48, , 9F
06/06 00:48, 9F
→
06/06 00:48, , 10F
06/06 00:48, 10F
→
06/06 00:54, , 11F
06/06 00:54, 11F
→
06/06 00:55, , 12F
06/06 00:55, 12F
→
06/06 03:30, , 13F
06/06 03:30, 13F
→
06/06 03:31, , 14F
06/06 03:31, 14F