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

📄 关键字static总结之二.htm

📁 我收集的一些C++BUILDER编程用的知识,适合于初学者使用
💻 HTM
📖 第 1 页 / 共 5 页
字号:
        <TBODY>
        <TR>
          <TD class=titleback1>相关文章</TD></TR>
        <TR>
          <TD vAlign=top height=100>· <A title=关键字static总结之一 
            href="http://www.malegebide.com/article/1/14/2006/2006092518451.html">关键字static总结之..</A><BR>· 
            <A title=虚拟设备驱动程序(VxD)设计中的两个关键问题 
            href="http://www.malegebide.com/article/1/14/2006/2006092517455.html">虚拟设备驱动程序(V..</A><BR>· 
            <A title="STL知识准备: 1. C++关键字typename" 
            href="http://www.malegebide.com/article/1/14/2006/2006092517411.html">STL知识准备: 
            1. C+..</A><BR>· <A title=优化了的过关键点的光滑曲线拟合算法的修正(一个链表的定义) 
            href="http://www.malegebide.com/article/1/14/2006/2006092517341.html">优化了的过关键点的..</A><BR>· 
            <A title=优化了的过关键点的光滑曲线拟合算法 
            href="http://www.malegebide.com/article/1/14/2006/2006092517309.html">优化了的过关键点的..</A><BR>· 
            <A title="GMPLS 的关键技术" 
            href="http://www.malegebide.com/article/45/2006/2006092517306.html">GMPLS 
            的关键技术</A><BR>· <A title=MPLS的研究发展及其关键技术综述 
            href="http://www.malegebide.com/article/45/2006/2006092517253.html">MPLS的研究发展及其..</A><BR>· 
            <A title=说说使用static和const关键字 
            href="http://www.malegebide.com/article/41/2006/2006092516379.html">说说使用static和co..</A><BR>· 
            <FONT color=#0066ff>[图文]</FONT> <A title=我对于关键字Ref和Out的理解 
            href="http://www.malegebide.com/article/41/2006/2006092515081.html">我对于关键字..</A><BR>· 
            <FONT color=#0066ff>[图文]</FONT> <A title="分享经验:Web 2.0 网站成功的关键" 
            href="http://www.malegebide.com/article/7/36/2006/2006091913737.html">分享经验:We..</A><BR></TD></TR></TBODY></TABLE></TD>
    <TD class=tableright align=right width=588>
      <TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" cellSpacing=0 
      cellPadding=0 width=575 border=0>
        <TBODY>
        <TR>
          <TD style="FONT-SIZE: 12pt; COLOR: #ff6600" align=middle 
            height=32>关键字static总结之二</TD></TR>
        <TR>
          <TD align=middle bgColor=#f7f7f7 
            height=25>作者:佚名&nbsp;&nbsp;来源:不详&nbsp;&nbsp;发布时间:25/09/2006 
            19:55:18&nbsp;&nbsp;发布人:admin</TD></TR>
        <SCRIPT language=javascript>
var newasp_fontsize=9;
var newasp_lineheight=12;
</SCRIPT>

        <TR>
          <TD>
            <P align=right><A title=减小字体 
            style="CURSOR: hand; POSITION: relative" 
            onclick='if(newasp_fontsize>8){NewaspContentLabel.style.fontSize=(--newasp_fontsize)+"pt";NewaspContentLabel.style.lineHeight=(--newasp_lineheight)+"pt";}'><IMG 
            height=15 src="关键字static总结之二.files/1.gif" width=15 border=0><FONT 
            color=#ff6600>减小字体</FONT></A> <A title=增大字体 
            style="CURSOR: hand; POSITION: relative" 
            onclick='if(newasp_fontsize<64){NewaspContentLabel.style.fontSize=(++newasp_fontsize)+"pt";NewaspContentLabel.style.lineHeight=(++newasp_lineheight)+"pt";}'><IMG 
            height=15 src="关键字static总结之二.files/2.gif" width=15 border=0><FONT 
            color=#ff6600>增大字体</FONT></A> </P>
            <DIV class=ContentFont id=NewaspContentLabel 
            style="PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"><FONT 
            id=font_word 
            style="FONT-SIZE: 14px; FONT-FAMILY: 宋体, Verdana, Arial, Helvetica, sans-serif">
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>三:静态(<SPAN 
            lang=EN-US>static)几个典型的应用:<o:p></o:p></SPAN></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 39.0pt"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: 宋体"><SPAN 
            style="mso-list: Ignore"><FONT size=3>1.</FONT><SPAN 
            style="FONT: 7pt ''''Times New Roman''''">&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>代替<SPAN lang=EN-US>menu的作用(menu 
            hank)<o:p></o:p></SPAN></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>大家都知道如果程序要在,要在类定义的内部直接初始化变量并使用对于以夜的编译器只能使用<SPAN 
            lang=EN-US>menu来达到这种效果,代码像这样:<o:p></o:p></SPAN></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3><SPAN 
            style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN>class print<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>{<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3><SPAN 
            style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN>menu{count = 10 };//借助枚举来得到一个初始值<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3><SPAN 
            style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN>string info[count];<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>};<SPAN style="mso-tab-count: 1">&nbsp; 
            </SPAN><o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3><SPAN 
            style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN>用MFC编写过程序代码的都应该知道这个功能,它就是通过menu来接初始化类中的IDD然后进行使用,看一面一段MFC产生的代码<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>///////////////////////////////////////////////////////////////////////<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><FONT size=3><SPAN lang=EN-US 
            style="COLOR: blue; FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''">class</SPAN><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"> 
            CACETESTDlg : <SPAN style="COLOR: blue">public</SPAN> 
            CDialog<o:p></o:p></SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3>{<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><FONT size=3><SPAN lang=EN-US 
            style="COLOR: blue; FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''">public</SPAN><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''">:<o:p></o:p></SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><FONT size=3><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><SPAN 
            style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN 
            lang=EN-US 
            style="mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-fareast-font-family: 新宋体; mso-ascii-font-family: 新宋体">……</SPAN><SPAN 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''">其它成员函数和构造函数的定义<SPAN 
            lang=EN-US style="COLOR: green"><o:p></o:p></SPAN></SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: 2.0" 
            align=left><SPAN lang=EN-US 
            style="COLOR: green; FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3>// 对话框数据<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; 
            </SPAN><SPAN style="COLOR: blue">enum</SPAN> { IDD = 
            IDD_ACETEST_DIALOG };<SPAN style="COLOR: green"> 
            //使用menu直接初始化IDD,IDD_ACETEST_DIALOG是对话框的ID值</SPAN><o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><SPAN 
            style="mso-spacerun: yes">&nbsp; </SPAN>//</SPAN><SPAN lang=EN-US 
            style="mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-fareast-font-family: 新宋体; mso-ascii-font-family: 新宋体">……</SPAN><SPAN 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''">其他成员函数的定义。<SPAN 
            lang=EN-US><o:p></o:p></SPAN></SPAN></FONT></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3>};<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><o:p><FONT 
            size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>//实现文件<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt"><FONT 
            size=3>//……<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3>CACETESTDlg::CACETESTDlg(CWnd* pParent <SPAN 
            style="COLOR: green">/*=NULL*/</SPAN>)<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN>: 
            CDialog(CACETESTDlg::IDD, pParent)<SPAN 
            style="COLOR: green">//注:这里直接使用IDD初始化基类。<o:p></o:p></SPAN></FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" 
            align=left><SPAN lang=EN-US 
            style="FONT-FAMILY: 新宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-hansi-font-family: ''''Times New Roman''''"><FONT 
            size=3>{<o:p></o:p></FONT></SPAN></P>
            <P class=MsoNormal 

⌨️ 快捷键说明

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