⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mbasicsc.htm

📁 一个非常适合初学者入门的有关c++的文档
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">
<HTML>
<HEAD>
<TITLE>More Effective C++ | Basics</TITLE>

<SCRIPT LANGUAGE="Javascript" SRC="../JAVA/COOKIE.JS"></SCRIPT>
<SCRIPT LANGUAGE="Javascript">var imagemax = 0; setCurrentMax(0);</SCRIPT>
<SCRIPT LANGUAGE="Javascript" SRC="../JAVA/DINGBATS.JS"></SCRIPT>
<SCRIPT>
var dingbase = "MBASICDR.HTM";
var dingtext = "MEC++ Basics, P";
if (self == top) {
 top.location.replace(dingbase + this.location.hash);
}
</SCRIPT>

</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" ONLOAD="setResize()">
<!-- SectionName="MEC++ Chapter Intro: Basics" -->
<LINK REL=STYLESHEET HREF=../INTRO/ECMEC.CSS>
<A NAME="10979"></A>
<DIV ALIGN="CENTER"><FONT SIZE="-1">Back to <A HREF="./MIINTRFR.HTM" TARGET="_top" onMouseOver = "self.status = 'Back to Introduction'; return true" onMouseOut = "self.status = self.defaultStatus">Introduction</A> &nbsp;&nbsp;<BR>&nbsp;&nbsp;Continue to <A HREF="./MI1_FR.HTM" TARGET="_top" onMouseOver = "self.status = 'Continue to MEC++ Item 1'; return true" onMouseOut = "self.status = self.defaultStatus">Item 1: Distinguish between pointers and references</A></FONT></DIV>

<A NAME="p9"></A>
<P><A NAME="dingp1"></A><font ID="mgtitle">Basics</font><SCRIPT>create_link(1);</SCRIPT>
</P>

<p><A NAME="dingp2"></A><A NAME="72054"></A>
Ah, the basics. Pointers, references, casts, arrays, constructors &#151; you can't get much more basic than that. All but the simplest C++ programs use most of these features, and many programs use them <NOBR>all.<SCRIPT>create_link(2);</SCRIPT>
</NOBR></P>
<P><A NAME="dingp3"></A><A NAME="72055"></A>
In spite of our familiarity with these parts of the language, sometimes they can still surprise us. This is especially true for programmers making the transition from C to C++, because the concepts behind references, dynamic casts, default constructors, and other non-C features are usually a little <NOBR>murky.<SCRIPT>create_link(3);</SCRIPT>
</NOBR></P>
 <P><A NAME="dingp4"></A><A NAME="41894"></A>
This chapter describes the differences between pointers and references and offers guidance on when to use each. It introduces the new C++ syntax for casts and explains why the new casts are superior to the C-style casts they replace. It examines the C notion of arrays and the C++ notion of polymorphism, and it describes why mixing the two is an idea whose time will never come. Finally, it considers the pros and cons of default constructors and suggests ways to work around language restrictions that encourage you to have one when none makes <NOBR>sense.<SCRIPT>create_link(4);</SCRIPT>
</NOBR></P>
<P><A NAME="dingp5"></A><A NAME="65857"></A>
By heeding the advice in the items that follow, you'll make progress toward a worthy goal: producing software that expresses your design intentions clearly and <NOBR>correctly.<SCRIPT>create_link(5);</SCRIPT>
</NOBR></p>

<DIV ALIGN="CENTER"><FONT SIZE="-1">Back to <A HREF="./MIINTRFR.HTM" TARGET="_top" onMouseOver = "self.status = 'Back to Introduction'; return true" onMouseOut = "self.status = self.defaultStatus">Introduction</A> &nbsp;&nbsp;<BR>&nbsp;&nbsp;Continue to <A HREF="./MI1_FR.HTM" TARGET="_top" onMouseOver = "self.status = 'Continue to MEC++ Item 1'; return true" onMouseOut = "self.status = self.defaultStatus">Item 1: Distinguish between pointers and references</A></FONT></DIV>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -