找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 750|回复: 2

求助:编译错误,不知道怎么办啊,谢谢了

[复制链接]
发表于 2009-11-3 03:25:11 | 显示全部楼层 |阅读模式 IP:江苏扬州
源代码:
头文件:ListStruct.h

    typedef float DataType; //假设结点的数据类型是字符型
typedef struct node { //结点类型定义
DataType data;
struct node *next;//结点的指针域
}ListNode;
typedef ListNode * LinkList;



ListStruct.cpp

#include "iostream.h"
#include "string"
#include "ListStruct.h"
LinkList CreatList (float ch)
{ //用尾插法建立带头结点的单链表
LinkList head = (LinkList)malloc(sizeof( ListNode)); //生成头结点
ListNode *s , *r;
r=head;//尾指针亦指向头结点
s=(ListNode *) malloc (sizeof(ListNode));
s->data=ch;
r->next=s;
r=s;
r->next=NULL;
return head;
}
void OutList( LinkList L)
{
ListNode *p;
p=L;
while (p->next)
{
cout << p->next->data << " " ;
p=p->next;
}
cout << endl;
}
int main()
{
LinkList A;
cout<<"输入高程:"<<" ";
float er;
cin>>er;
CreatList (er);
return 0;
}



编译错误:


编译器: Default compiler
执行  g++.exe...
g++.exe "E:\Program Files\新建文件夹\ListStruct.cpp" -o "E:\Program Files\新建文件夹\ListStruct.exe"    -I"d:\Dev-Cpp\include\c++"  -I"d:\Dev-Cpp\include\c++\mingw32"  -I"d:\Dev-Cpp\include\c++\backward"  -I"d:\Dev-Cpp\include"   -L"d:\Dev-Cpp\lib"
In file included from d:/Dev-Cpp/include/c++/backward/iostream.h:31,
                 from E:/Program Files/新建文件夹/ListStruct.cpp:1:
d:/Dev-Cpp/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
E:/Program Files/新建文件夹/ListStruct.cpp: In function..`ListNode*
   CreatList(float)':
E:/Program Files/新建文件夹/ListStruct.cpp:13: warning: assignment to `DataType
   ' from `float'
E:/Program Files/新建文件夹/ListStruct.cpp:13: warning: argument to `char' from
   `float'
E:/Program Files/新建文件夹/ListStruct.cpp: In function..`int main()':
E:/Program Files/新建文件夹/ListStruct.cpp:36: stray '\243' in program
E:/Program Files/新建文件夹/ListStruct.cpp:36: stray '\273' in program
E:/Program Files/新建文件夹/ListStruct.cpp:37: parse error before `>>' token
执行结束


我怎么也改不过来了

求助啊
先谢谢大家了
发表于 2009-11-3 03:25:13 | 显示全部楼层 IP:江苏扬州
比较容易看出来的问题是:
int main()   里面要补全 int argc, char * argv[]
include <iostream.h> 不能用“”代替
回复

使用道具 举报

发表于 2009-11-3 03:25:15 | 显示全部楼层 IP:江苏扬州
按楼上方法还是不对啊

编译器: Default compiler
执行  g++.exe...
g++.exe "E:\Program Files\新建文件夹\ListStruct.cpp" -o "E:\Program Files\新建文件夹\ListStruct.exe"    -I"d:\Dev-Cpp\include\c++"  -I"d:\Dev-Cpp\include\c++\mingw32"  -I"d:\Dev-Cpp\include\c++\backward"  -I"d:\Dev-Cpp\include"   -L"d:\Dev-Cpp\lib"
In file included from d:/Dev-Cpp/include/c++/backward/iostream.h:31,
                 from E:/Program Files/新建文件夹/ListStruct.cpp:1:
d:/Dev-Cpp/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
E:/Program Files/新建文件夹/ListStruct.cpp: In function `int main(int,
   char**)':
E:/Program Files/新建文件夹/ListStruct.cpp:36: stray '\243' in program

E:/Program Files/新建文件夹/ListStruct.cpp:36: stray '\273' in program
E:/Program Files/新建文件夹/ListStruct.cpp:37: parse error before `>>' token

执行结束
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 13:27 , Processed in 0.217746 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表