發新話題
打印

識C Program請進!!

識C Program請進!!

我想問

const係點解???

同埋可以指教點做一個sodoku既program呀???

TOP

'const' 表示那個是不變數:
e.g.   const int x=10;       // x=10 all the time in the function, changes will lead to errors
                   x=9;             // this is an error

另一方面,你也可以用在set functions:
e.g.  void  function1(const int y) {    // y will be the value put into when the function is called and should not be changed in the function.
                  y=8;                               // this is an error
         }
         ........
         function1(7);                          //y=7 in the function.

TOP

我想問typedef同埋static係c++內點解呢??

TOP

引用:
原帖由 sleeppig992 於 2006-10-19 21:48 發表
我想問typedef同埋static係c++內點解呢??
係咪code呢啊!!

TOP

發新話題