第四章 面向对象编程 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
本项目充分运用了所学的C++面向对象程序设计理论知识,使用类、对象来设计图书借阅系统。 一、系统的功能包括: (1)、图书管理员 1、管理读者账户:添加读者账户、查阅、维护读者信息。 2. 管理图书:对图书分类、编条码;图书上架、下架;查阅、维护图书信息。 (2)、读者 1、借书:通过互联网查看图书、预约借阅,到图书馆取书、借书。 2、还书:将书还到借书处。 二、业务流程: 1. 图书管理员将新进的图书分类、编码、输入数据库,并将图书分类放置到书架上; 2. 读者通过网络或者图书管理员建立读者账号,获得以PIN标识的借书卡; 3. 读者到书库浏览图书,将图书选到书车上,凭借书卡号码借书; 4. 读者还书时只需将图书投入还书窗口,计算机自动扫描条码将图书记录从读者账户消除; 5. 图书管理员将图书从还书窗口上架,供读者借阅。
2022-10-30 17:25:50 8KB c++ 项目架构 面向对象编程
C#练习2:员工信息查询和删除.zip
2022-09-24 00:18:11 90KB C# 面向对象编程
1
面向对象的程序设计 在Coursera上完成Java专业化的面向对象编程的工作
2022-09-01 22:31:40 21.81MB Java
1
Matlab面向对象编程
2022-08-13 00:09:09 2.68MB MATLA
1
便便 ##面向对象编程 2014/15 ###Learning 动态贝叶斯网络 ####MEEC IST 更多信息 ->
2022-08-09 18:37:51 2.01MB Java
1
面向对象的软件构造导论实验课---IntelliJ IDEA软件实现---Java语言编写---单机版飞机大战。 这个是单机版飞机大战的完整文件包,解压后即可运行。 不过还是,建议大家还是去看我写的文章: https://blog.csdn.net/qq_52399968/article/details/126186449
2022-08-06 09:05:58 18.69MB java 面向对象编程
1
数据库系统课件:第4章 面向对象编程基础.ppt
2022-06-27 19:07:12 310KB 数据库系统
讲解C++11/14标准的使用方法,讲解到位,语言风趣,读之甘之如饴。PDF格式的哦,很清晰。
2022-06-23 16:13:44 94.86MB c++ 面向对象编程 并发
1