俊's profile俊俊的共享空间PhotosBlogLists Tools Help

Blog


    March 09

    C++ VS Java

    C++:

    强大功能:模板(GP),继承(OO),封装(OO),异常(除错)

    编译的静态性:编译器是根据数据静态类型来处理的

    四个步骤:预编译编译连接运行

    冯诺伊曼原理要素:代码,数据,堆栈

    无非是编译器做了很多幕后工作的C而已,会自动安插代码进去

    (等位转型,非等位转型)

    1非等位转型会在运行时有所体现,等位转型与运行时的过程无关

    2强类型匹配后才能通过编译是为了保护程序员正确编写代码,等位转型操作则是破坏了这种保护机制,但是增加了灵活性,可以欺骗编译器做特殊处理,往往底层的、核心的程序相对来说这种做法比较多,不过需要很多严格区分预编译编译连接,和运行时的知识

     

    从编译器的角度理解几个为什么:

    1为什么模板类,模板函数全部在h文件里面定义?

    2为什么内联函数的定义在h文件里面?

    3为什么静态成员的初始化在cpp文件里面?

     

    Win32 API

    记忆性(Windows系统的窗口类结构,窗口结构就是一个佐证)

    绝对功能性(无可厚非)

    OS密切相关性(操纵OS的另一种接口而已)

    资源有限性(getreleasecreatedelete

    冯老原理要素:数据,硬件关联的数据的输入输出(所有的OS均如此)

    说明:要记住UI窗口与WindowsUSER模块之间的密切关系

     

    Application Framework

    MFC:(C++封装Windows API,借用COM API,也可以开发COM组件)

    ATL(模板、多继承,C++封装Windows API,借用COM API,适合开发COM组件)

    微软的开发人员特别喜欢使用宏,宏虽然容易产生很多问题但是使用的恰当还是很好的

    静态结构的初始化依赖于C运行时函数main函数,并且顺序很重要

     

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://iuq-qj.spaces.live.com/blog/cns!4138B0A9810421A4!219.trak
    Weblogs that reference this entry
    • None