【Morgan Stanley IKM在线测试】C++

本文介绍了大摩IT笔试中C++部分的内容,涉及XML DOCTYPE、C++ new异常处理、STL容器适配器、volatile关键字的使用以及析构函数异常问题。建议参考《Effective C++》和《C++ Primer》。网友分享的体验显示,测试包含多线程、内存管理、设计模式等广泛知识,且题型为选择题,答题正确率重于速度。
摘要由CSDN通过智能技术生成

掌握好基础啊!<<Effective C++>>,<<C++ Primer>>


 考核内容包括不限于:

重构,重载,析构函数里(重构,重载,)new,malloc异常 堆和栈

OOP,OSI七层模型(应用层:http,ftp  传输层:tcp)

设计模式,UML图

Xml(DocTYPe)

数据库 sybase


1. XML DOCTYPE

2.10.2 The DOCTYPE declaration

An XML file which is valid (as opposed to simply well-formed) must specify a DTD against which its content is to be validated. This is the function of the DOCTYPE declaration.

The DOCTYPE declaration contains, following the DOCTYPE keyword, at least two parts: the name of the root element for the associated document, and a set of declarations for all the elements, attributes, notations, entities, etc. which together define the document type declaration (DTD) of that document. Note, incidentally, that the root element name (and hence the DOCTYPE name) may be that of any element whose declaration is supplied in this set. The declarations may be supplied explicitly, or by reference to an external entity such as a file, or by a combination of the two.

Taking each of these possibilities in turn, we first present a DOCTYPE declaration in which the declarations for all the elements, attributes, etc. required are given explicitly:

<!DOCTYPE myDoc [
  <!ELEMENT myDoc (p+) >
  <!ATTLIST myDoc n CDATA #IMPLIED>
  <!ELEMENT p (#PCDATA)>
]>
<myDoc n="1">
  <p>This is an instance of a "my.doc" document</p>
</myDoc>
Note that the required declarations are enclosed within square brackets inside the  DOCTYPE  declaration: this part of the declaration is technically known as the  DTD subset .

More usually, however, the required declarations will be held in a separate entity and invoked by reference, as follows:

<!DOCTYPE myDoc SYSTEM "myDoc.dtd" []>
<myDoc>
  <p>This is another instance of a "myDoc" document.</p>
  <p>It has two paragraphs.</p>
</myDoc>
Note the similarity between the syntax used to reference the external entity containing the required declarations and that used to define any other system entity (see  2.7.1 Entity declarations ). The square brackets may be supplied even though they enclose nothing, as in this example, or they may be omitted.

Next, we present a case where declarations are given both within the DTD subset and by reference to an external entity:

<!DOCTYPE myDoc SYSTEM "myDoc.dtd" [
  <!ENTITY tla "three letter acronym">]>
<myDoc>
  <p>This is yet another instance of a "myDoc" document.</p>
  <p>It is surprisingly free of &tla;s.</p>
</myDoc>

Any kind of declaration may be added to a DTD subset; as we have already seen (2.8.2 Conditional marked section), this is the mechanism by which the TEI DTD is customized.

<!DOCTYPE TEI.2 PUBLIC "-//TEI P3//DTD Main Document Type//EN" "tei2.dtd" [
  <!ENTITY % TEI.prose 'INCLUDE'>
  <!ENTITY % TEI.XML   'INCLUDE'>
  <!ENTITY tla "Three Letter Acronym">
  <!ENTITY % x.phrase  'myTag|'>	 
  <!ELEMENT myTag (#PCDATA)    >
  <!-- any other special-purpose declarations or
       re-declarations go  here -->
  ]>
<TEI.2>
  <!-- This is an instance of a modified TEI.2 type document, which
       may contain <myTag>my special tags</myTag> and references 
       to my usual entities such as &tla;. -->
</TEI.2>
When, as here, the document type declaration in force includes both the contents of the DTD subset, and the contents of some external entity (in the case above, whatever file is specified by the  PUBLIC  identifier given,  tei2.dtd  by default), declarations in the DTD subset are always carried out first. As noted above, ( 2.7.5 Parameter entities ), the order is important, because in XML only the first declaration of an entity counts. In the above example, therefore, the declaration of the entity  tla  in the DTD subset takes precedence over any declaration of the same entity in the file  tei2.dtd
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值