第四章 面向对象编程 Object-oriented Programming 1. 类,构造函数和析构函数,类的指针 Classes. Constructors and Destructors. Pointers to classes. 2. 操作符重载,this,静态成员 Overloading Operators. this. Static members 3. 类之间的关系 Relationships between classes: friend. Inheritance 4. 虚拟成员,抽象,多态 Virtual Members. Abstraction. Polymorphism 4.1 类(Classes) 类(class)是一种将数据和函数组织在同一个结构里的逻辑方法。定义类的关键字为 class ,其功能与 C 语言中的 struct 类似,不同之处是 class 可以包含函数,而不像 struct 只能包含数据元素。 类定义的形式是: class class_name { permission_label_1: member1;
2022-11-05 17:02:32 861KB C++ C++基础
1
C++面向对象编程八皇后问题 BOOL CMyqueenApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMyqueenDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CMyqueenView)); AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; VERIFY( 1 == InitSkinMagicLib( AfxGetInstanceHandle(), "Demo" , NULL, NULL ) ); VERIFY( 1 == LoadSkinFromResource( AfxGetInstanceHandle() , "DEFAULT" ,"DEFAULT") ); VERIFY( 1 == SetWindowSkin( m_pMainWnd->m_hWnd , "MainFrame" )); VERIFY( 1 == SetDialogSkin( "Dialog" ) ); //((CMainFrame*)m_pMainWnd)->m_bSkinned = TRUE; //((CMainFrame*)m_pMainWnd)->m_nIndex = 0; m_pMainWnd->SetWindowText("八皇后问题演示"); // The one and only window has been initialized, so show and update it. m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow();
2022-11-04 16:21:50 2.52MB C++
1
T-spline 是一种定义自由曲面的新方法,其控制点比 NURBS 少,并且能够使用单个曲面表示模型而不会出现连接错误。 而T-spline数据模型的复杂性导致其编程困难重重,阻碍了T-spline技术的研究与发展。 在这里,T-SPLINE 内核给出了一组重新设计的数据模型,这些模型对人和计算机的理解都更加方便。 有关更多详细信息,请参阅我们的文章:“使用 STEP 重新考虑 T-spline 数据模型及其交换”
2022-11-04 15:10:36 8.23MB 开源软件
1
这是面向对象课程的全部课件,PDF版,主要内容有继承,多态,面向对象编程,设计模式及其示例。
2022-11-03 18:48:44 4.91MB 面向对象 设计模式 C++
1
面向对象的程序设计语言——C++_第二版-习题参考答案.pdf
1
本项目充分运用了所学的C++面向对象程序设计理论知识,使用类、对象来设计图书借阅系统。 一、系统的功能包括: (1)、图书管理员 1、管理读者账户:添加读者账户、查阅、维护读者信息。 2. 管理图书:对图书分类、编条码;图书上架、下架;查阅、维护图书信息。 (2)、读者 1、借书:通过互联网查看图书、预约借阅,到图书馆取书、借书。 2、还书:将书还到借书处。 二、业务流程: 1. 图书管理员将新进的图书分类、编码、输入数据库,并将图书分类放置到书架上; 2. 读者通过网络或者图书管理员建立读者账号,获得以PIN标识的借书卡; 3. 读者到书库浏览图书,将图书选到书车上,凭借书卡号码借书; 4. 读者还书时只需将图书投入还书窗口,计算机自动扫描条码将图书记录从读者账户消除; 5. 图书管理员将图书从还书窗口上架,供读者借阅。
2022-10-30 17:25:50 8KB c++ 项目架构 面向对象编程 类
C++面向对象练习,输出一段时间的电表读数并对其进行统计
2022-10-20 09:14:29 27KB C++, 面向对象
1
C++面向对象程序设计(第五版)alter Savitch著周靖译(清华大学出版社)课后答案,感谢别人的整理,我给拿过来分享给大家,
2022-10-07 12:24:40 73KB c++ 答案
1
数据结构与算法-面向对象的C++设计模式.pdf你设计大型软件必备的基础。
1
介绍代码规范、重构 复用 业务的封装 体会简单工厂模式的美妙
2022-09-29 17:41:39 1.33MB c#
1