当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《面向对象程序设计》课程教学资源(Exercise)6

资源类别:文库,文档格式:DOC,文档页数:1,文件大小:29KB,团购合买
Exercises 5(15) 1. Write a class with one virtual function and one non-virtual function Inherit a new class, make an object of this class, and upcast to a pointer of the base-class type. Use the clock( function found in (you'll need to look this up in your local C library guide) to measure the
点击下载完整版文档(DOC)

Exercises 5(15) 1 Write a class with one virtual function and one non-virtual function Inherit a new class. make an object of this class, and upcast to a pointer of the base-class type. Use the clock( )function found in (you'll need to look this up in your local C library guide) to measure the difference between a virtual call and non-virtual call. You ll need to make multiple calls to each function inside your timing loop in order to see the difference 2 Create a class that has a data member and a derived class that adds another data member. write a non-member function that takes an object of the base class by value and prints out the size of that object using sizeof. In main( )create an object of the derived class, print out its size, and then call your function. Explain what happens

Exercises 5 (15) 1、Write a class with one virtual function and one non-virtual function. Inherit a new class, make an object of this class, and upcast to a pointer of the base-class type. Use the clock( ) function found in (you’ll need to look this up in your local C library guide) to measure the difference between a virtual call and non-virtual call. You’ll need to make multiple calls to each function inside your timing loop in order to see the difference. 2、Create a class that has a data member and a derived class that adds another data member. Write a non-member function that takes an object of the base class by value and prints out the size of that object using sizeof. In main( ) create an object of the derived class, print out its size, and then call your function. Explain what happens

点击下载完整版文档(DOC)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有