编译C++程序时报错:“unable to start program' e\visual studio 2005 \vc\projects\debug\list.exe”为什么debug文件夹中不能生成list.exe可执行文件呢?

yao450860487 2008-10-16 02:38:10



代码如下:




List1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
int main(array<System::String ^> ^args)
{

const string a ="the sentinel is";
const float sentinel=-1.00;
const string result1="升序排列是:";

const string result2="降序排列是:";
Bidirectional Iterator <float>list;
cout<<a<<sentinel<<":";
float num;
cin>>num;
while(num!=sentinel)
{
list.push_front(num);
cout<<a<<sentinel<<":";
cin>>num;
}
Bidirectional Iterator<float>::Iterator itr;
cout<<result1<<endl;
for(itr=list.begin();itr!=list.end();itr++)
{
cout<<*itr<<endl;

}
cout<<result2<<endl;
for(itr=list.end();itr!=list.begin();itr--)
{
cout<<*itr<<endl;
}

}

return 0;
}


#pragma once

// TODO: 在此处引用程序需要的其他头文件
//#ifndef Bidirectional Iterator
#define Bidirectional Iterator


template<class T>
class Bidirectional Iterator
{
protected:
struct Node
{
T item;
Node* prey;
Node* next;
} // struct Node

Node* head;
long length;

public:
class Iterator
{
friend class Bidirectional Iterator;
Iterator(Node* newPtr)
{
nodePtr=newPtr;
}

public:
Iterator(){}

Node* nodePtr;
}
Bidirectional Iterator()
{
head=NULL;
length=0;
}
long size() const
{
return length;
}
public:
void push_front (const T& newItem)
{
Node* newHead=new newNode;
newHead -> item=newItem;
newHead -> next=head;
head ->prey=newHead;
length++;
}
public:
void pop_front()
{
Node* oldHead=head;
head=(*head).next;
delete oldhead;
}
// void operator= (const Linked<T>& otherLinked)
Iterator begin()
{
return Iterator(head);

}
Iterator end()
{
return Iterator(NULL);

}
~Linked()
{
while(head!=NULL)
pop_front();
}
Iterator operator++(int)
{
Iterator temp=*this;
nodePtr=(*nadePtr).next
return temp;
}
Iterator operator--(int)
{
Iterator temp=*this;
nodePtr=(*nodePtr).prey;
return temp;
}

// Postcondition: true has been returned if the
// iterator is equal to itr; otherwise,
// false has been returned.
bool operator== (const Iterator& itr) const
{
return nodePtr == itr.nodePtr;
} // overloading ==

// Postcondition: true has been returned if the
// iterator is not equal to itr;
// otherwise, false has been returned.
bool operator!= (const Iterator& itr) const
{
return nodePtr != itr.nodePtr;
} // overloading !=





}; // class Linked
...全文
681 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuzhangkai 2011-10-18
  • 打赏
  • 举报
回复
我也是啊 !悲催,牛人在哪???
mayuan3123 2010-05-26
  • 打赏
  • 举报
回复
同一问题,求助!!!
yao450860487 2008-10-16
  • 打赏
  • 举报
回复
刚编译就报错“list.exe可执行文件”找不到,编译不起,也就不晓得错误在哪里,我就想通过调试来改正程序中的错误。囊个处理“list.exe可执行文件”的问题呢???
yao450860487 2008-10-16
  • 打赏
  • 举报
回复
刚编译就报错“list.exe可执行文件”找不到,编译不起,也就不晓得错误在哪里,我就想通过调试该程序的错误。囊个处理“list.exe可执行文件”的问题呢???
JJZHK 2008-10-16
  • 打赏
  • 举报
回复
你的程序好像错误超多阿。你还是好好看看吧。
xkyx_cn 2008-10-16
  • 打赏
  • 举报
回复
rebuild all

64,637

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧