📄 [转载]vc++7_1转移到vc++2005 需要的一些变动.htm
字号:
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">10</SPAN><SPAN
style="COLOR: rgb(0,0,0)">).. </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)">error in Vc8</SPAN><SPAN
style="COLOR: rgb(0,128,0)"><BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">for</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> (i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; i </SPAN><SPAN
style="COLOR: rgb(0,0,0)"><</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">5</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; </SPAN><SPAN
style="COLOR: rgb(0,0,0)">++</SPAN><SPAN
style="COLOR: rgb(0,0,0)">i) </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)">error in Vc8</SPAN></DIV>
<P>解决方法:<BR>在for语句之前声明变量(可保证代码在vc7.1和vc8下同时编译通过)</P>
<DIV
style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top><SPAN style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; <BR><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">for</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> (i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; i </SPAN><SPAN
style="COLOR: rgb(0,0,0)"><</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">10</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; </SPAN><SPAN
style="COLOR: rgb(0,0,0)">++</SPAN><SPAN
style="COLOR: rgb(0,0,0)">i)<BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">for</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> (i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; i </SPAN><SPAN
style="COLOR: rgb(0,0,0)"><</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">5</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; </SPAN><SPAN
style="COLOR: rgb(0,0,0)">++</SPAN><SPAN
style="COLOR: rgb(0,0,0)">i)</SPAN></DIV>
<P><SPAN style="COLOR: rgb(0,0,255)"><STRONG>2. 指针和引用的声明
<BR></STRONG></SPAN>在Vc7.1中, 下面的代码可以编译, 但是vc8会报C4430
错误。(很难想象有些美国程序员竟然这样声明)</P>
<DIV
style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top><SPAN style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">&</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> a; </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)">error in VC8</SPAN><SPAN
style="COLOR: rgb(0,128,0)"><BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">*</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> b; </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)">error in VC8</SPAN><SPAN
style="COLOR: rgb(0,128,0)"><BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> myfun (</SPAN><SPAN
style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">&</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> B); </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)">error in VC8</SPAN></DIV>
<P>解决方法:<BR>把* 或&放到类型的后面.</P>
<DIV
style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top><SPAN style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)">&</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> a; <BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)">*</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> b;<BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> myfun (</SPAN><SPAN
style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> B</SPAN><SPAN
style="COLOR: rgb(0,0,0)">&</SPAN><SPAN
style="COLOR: rgb(0,0,0)">);</SPAN></DIV>
<P><SPAN style="COLOR: rgb(0,0,255)"><STRONG>3. 默认int类型
</STRONG></SPAN><BR>在vc7.1中,如果定义一个变量但不声明类型,那么默认为int。VC8不支持。<BR></P>
<DIV
style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top><SPAN style="COLOR: rgb(0,0,255)">static</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)"> C4430 error in Vc8 </SPAN><SPAN
style="COLOR: rgb(0,128,0)"><BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; </SPAN><SPAN
style="COLOR: rgb(0,128,0)">//</SPAN><SPAN
style="COLOR: rgb(0,128,0)">C4430 error</SPAN></DIV>
<P>解决方法:<BR>加上int.<BR></P>
<DIV
style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top><SPAN style="COLOR: rgb(0,0,255)">static</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">; <BR><IMG alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top></SPAN><SPAN
style="COLOR: rgb(0,0,255)">const</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,255)">int</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> i </SPAN><SPAN
style="COLOR: rgb(0,0,0)">=</SPAN><SPAN
style="COLOR: rgb(0,0,0)"> </SPAN><SPAN
style="COLOR: rgb(0,0,0)">0</SPAN><SPAN
style="COLOR: rgb(0,0,0)">;</SPAN></DIV>
<P><SPAN
style="COLOR: rgb(0,0,255)"><STRONG>4. 函数的默认返回值类型
</STRONG></SPAN><BR>同上,VC8不支持把 int 作为默认返回值类</P>
<DIV
style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><IMG
alt="" src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/None.gif"
align=top><SPAN style="COLOR: rgb(0,0,0)">Func()<BR><IMG
id=Codehighlighter1_7_17_Open_Image
onclick="this.style.display='none'; Codehighlighter1_7_17_Open_Text.style.display='none'; Codehighlighter1_7_17_Closed_Image.style.display='inline'; Codehighlighter1_7_17_Closed_Text.style.display='inline';"
alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/ExpandedBlockStart.gif"
align=top><IMG id=Codehighlighter1_7_17_Closed_Image
style="DISPLAY: none"
onclick="this.style.display='none'; Codehighlighter1_7_17_Closed_Text.style.display='none'; Codehighlighter1_7_17_Open_Image.style.display='inline'; Codehighlighter1_7_17_Open_Text.style.display='inline';"
alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/ContractedBlock.gif"
align=top></SPAN><SPAN id=Codehighlighter1_7_17_Closed_Text
style="BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; DISPLAY: none; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid; BACKGROUND-COLOR: rgb(255,255,255)"><IMG
alt=""
src="[转载]vc++7_1转移到vc++2005 需要的一些变动.files/dot.gif"></SPAN><SPAN
id=Codehighlighter1_7_17_Open_Text><SPAN
style="COLOR: rgb(0,0,0)">{</SPAN><SPAN
style="COLOR: rgb(0,0,255)">return</SPAN><SPAN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -