中国高校课件下载中心 》 教学资源 》 大学文库

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

文档信息
资源类别:文库
文档格式:DOC
文档页数:1
文件大小:29.5KB
团购合买:点击进入团购
内容简介
Exercises(210) Create a struct that holds two string objects and one int. Use a typedef for the struct name. Create an instance of the struct, initialize all three values in your instance, and print them out.
刷新页面文档预览

Exercises(210) 1, Create a struct that holds two string objects and one int. Use a typedef for the struct name Create an instance of the struct, initialize all three values in your instance, and print them out. Take the address of your instance and assign it to a pointer to your struct type. Change the three values in your instance and print them out, all using the pointer 2, Create two functions, one that takes a string* and one that takes a string&. Each of these functions should modify the outside string object in its own unique way. In main( ) create and initialize a string object, print it, then pass it to each of the two functions, printing the results

Exercises(210) 1、Create a struct that holds two string objects and one int. Use a typedef for the struct name. Create an instance of the struct, initialize all three values in your instance, and print them out. Take the address of your instance and assign it to a pointer to your struct type. Change the three values in your instance and print them out, all using the pointer. 2、Create two functions, one that takes a string* and one that takes a string&. Each of these functions should modify the outside string object in its own unique way. In main( ), create and initialize a string object, print it, then pass it to each of the two functions, printing the results

已到末页,全文结束
刷新页面下载完整文档
VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
相关文档