90068树怪会水攻:C++.NET与6.0的区别?

来源:百度文库 编辑:中科新闻网 时间:2024/04/30 15:09:02
我刚学C++不久,一直用visual C++6.0;同学说.NET好一点,所以我也就装了.NET,编了一个程序测试,发现在6.0上能运行,.NET上运行时出错,哪位帮忙一下?
#include<iostream>
#include<stdlib.h>
#include<time.h>
#include<list>

using namespace std;

void Create_List (list<int>&,int);
void Out_List (list<int>&);
void inorderMerge(list<int>&,const list<int>,list<int>);

int main()
{
list<int> L1(10),L2,L;
list<int>::iterator p;
srand(time(0));
Create_List(L1,10);
cout<<"list L1:\n";
Out_List(L1);
Create_List(L2,8);
cout<<"list L2:\n";
Out_List(L2);
inorderMerge(L,L1,L2);
cout<<"list L:\n";
Out_List(L);
return 0;
}

//建立升序链表
void Create_List(list<int> & orderList,int len)
{
list<int>::iterator p;
int i,k;
*(orderList.begin ())=rand()%100;
p=orderList.begin();
for(i=0;i<len;i++)
{
k=rand()%100;
p=orderList.begin ();
while(*p<k && p!=orderList.end())
p++;
orderList.insert(p,k);
}
}
//合并成降序链表
void inorderMerge (list<int>&L,list<int>L1,list<int>L2)
{
list<int>::const_iterator p,q;
p=L1.begin();
q=L2.begin();
while(p!=L1.end() && q!=L2.end())
{
if(*p<*q)
{
L.push_front(*p);
p++;
}
else
{
L.push_front(*q);
q++;
}
}
while(p!=L1.end())
{
L.push_front(*p);
p++;
}
while(q!=L2.end())
{
L.push_front(*q);
q++;
}
}
//输出链表
void Out_List(list<int>& List)
{
list<int>::iterator p;
p=List.begin();
while(p!=(List.end()))
{
cout<< *p<<" ";
p++;
}
cout<<endl;
}
还有,因为我对.NET还不熟悉(英文版),英语水平也一般般,谁能介绍一个说明.NET使用说明的网站?
谢谢!

我以Microsoft Visual C++.net为例,来说一说我发现的与Microsoft Visual C++6.0的不同之处。

(1) 首先看看目录文件架构的不同:(vc.net的默认安装目录为:…\ Microsoft Visual Studio .NET;而vc6.0默认安装目录为:…\Microsoft Visual Studio)

vc.net目录下的文件目录数比vc6.0的要多出一些,但主要的目录也大体上相同。只是原来的common变为了common7,vc98变为了vc7;我们主要看一下

vc7和vc98下的文件有什么不同;vc.net的前几个文件目录(包括:bin,include,lib,crt,atlmfc)与vc6.0基本相同,不同的是vc.net将atl和mfc合并为一个目录atlmfc,原来的mfc源代码可以在atlmfc\src\mfc中找到。

而vc7中的其他新增的文件目录则估计是微软细分功能的产物。我们暂不去考虑。

(2)配置应用程序使用环境:由于vs.net集成了vc++,vb,vc#等多种开发工具而且提供了多种配置方案,对于vc开发人员,推荐使用“vc++开发人员”配置。

(3)MFC应用程序向导差异:当分别在vc.net 和vc6.0用MFC应用程序向导创建新工程Test时,你就会发现MFC应用程序向导在两个版本中稍有不同。首先在

向导的样式上,vc.net使用的是嵌入浏览器模式而vc6.0使用的是对话框模式,而且vc.net在应用程序类型选项中提供了“多顶级文档”的方案和更加明显的

“用户界面功能”选项。

(4) 应用程序向导产生的各种文件的差异:下面列出两个版本中的功能对应的文件

教程这里看看

http://www.asp315.com/artical/4/181.htm