C语言编程要点--第18章程序的编写和编译.docVIP

  • 2
  • 0
  • 约6.71千字
  • 约 9页
  • 2017-03-08 发布于广东
  • 举报

C语言编程要点--第18章程序的编写和编译.doc

C语言编程要点--第18章程序的编写和编译

C语言编程要点---第18章 程序的编写和编译 第18章 程序的编写和编译 本章讲述在编译程序时可以使用的一些技术。在本章中,你将学到专业C程序员在日常编程中所使用的一些技巧。你将会发现,无论是对小项目还是大项目,把源代码分解成几个文件都是很有益处的。在生成函数库时,这一点更为重要。你还将学到可以使用的各种存储模式以及怎样为不同的项目选择不同的存储模式。如果你的程序是由几个源文件组成的,那么你可以通过一个叫MAKE的工具来管理你的项目 project 。你还将学到“.COM文件和.EXE文件的区别以及使用“.COM”文件的一个好处。 ? 此外,你还将学到用来解决一个典型的DOS问题的一些技巧,这个问题就是“没有足够的内存来运行DOS程序”。本章还讨论了扩展内存、扩充内存、磁盘交换区、覆盖管理程序和DOS扩展程序的用法,提出了解决RAM阻塞”这一问题的多种方法,你可以从中选择一种最合适的方法 18.1. 程序是应该写成一个源文件还是多个源文件? ? 如果你的程序确实很小又很紧凑,那么当然应该把所有的源代码写在一个“.C”文件中。然而,如果你发现自己编写了许多函数 特别是通用函数 ,那么你就应该把程序分解成几个源文件 也叫做模块 。 ? 把一个程序分解成几个源文件的过程叫做模块化程序设计 modular programming 。模块化程序设计技术提倡用几个不同的结构紧凑的模块一起组成一个完整的程序。例如,如果一个程序中有几种实用函数、屏幕函数和数据库函数,你就可以把这些函数分别放在三个源文件中,分别组成实用模块、屏幕模块和数据库模块。 ? 把函数放在不同的文件中后,你就可以很方便地在其它程序中重复使用那些通用函数。如果你有一些函数还要供其它程序员使用,那么你可以生成一个与别人共享的函数库 见18.9 。 ? 你永远不必担心模块数目“太多”——只要你认为合适,你可以生成很多个模块。一条好的原则就是保持模块的紧凑性.即在同一个源文件中只包含那些在逻辑上与其相关的函数。如果你发现自己把几个没有关系的函数放在了同一个源文件中,那么最好停下来检查一下程序的源代码结构,并且对模块做一下逻辑上的分解。例如,如果要建立一个通信管理数据库,你可能需要有这样一个模块结构: section of the Department of project management; Project documents and information: Project Engineering Department; Materials and equipment: material supply projects; Security controls: the project Department of safety and security; Construction machinery: Project Engineering Department; Financial: Project Management Department of finance; Security and fire services: project security. 3.3.5 management representative and project manager in this item specifies that the Chief Engineer is the management representative, responsible for the operation of quality management system and supervision, regardless of how his other responsibilities, should have a clear mandate to: ensure that the quality management system is implemented and maintained; The running of the quality management system to the project manager, including needed improvements; Always be aware that the customers needs and requirements. 3.4 3.4.1 project management review should be an annual review of its quality management system to ensure its continuing suitability, adequacy and ef

文档评论(0)

1亿VIP精品文档

相关文档