Programming Basic--what's the diff between const and #define?

        to define a const, we can use const as well as #define in C++ .however the former has more benifits than later.
        1) const has data type ,however Macro has no. so the complier can check the data type for the former , but not for the later.
        2) some integrated tools can debug with const while not with macro. therefore we can use const completely taking place of Macro.

posted on 2008-02-26 08:58  飞天舞者  阅读(204)  评论(0编辑  收藏  举报

导航

For more information about me, feel free email to me winston.he@hotmail.com