unexpected end of file found in comment
来源:互联网 发布:淘宝店铺怎么改名字啊 编辑:程序博客网 时间:2024/04/29 23:49
今天调试程序遇到下面一个错误:
unexpected end of file found in comment
#include"List.h"void InitList(List *list){Node *s = (Node *)malloc(sizeof(Node));assert(s != NULL);s->next = NULL;list->first = list->last = s;list->size = 0;}/*尾插法:开辟并初始化--->>连接---->>指针后移*/bool push_back(List *list,ElemType x){Node *s = (Node *)malloc(sizeof(Node));//开辟一个结点if(s == NULL){return false;}s->next = NULL;//对节点的初始化s->data = x;list->last->next = s;//连接list->last = s; //后移(尾指针后移)list->size++;return true;}void show_seqlist(List *list){Node *p = list->first->next;while(p != NULL){printf("%d\n",p->data);p = p->next;}}/*头插法:开辟并初始化--->>连接---->>指针后移 !!**注意特殊情况**!!*/bool push_front(List *list,ElemType x){Node *s = (Node *)malloc(sizeof(Node));if(s == NULL){return false;}s->data = x;s->next = list->first->next;list->first->next = s;//注意:如果是第一个结点,则尾指针需要改变指向即指向第一个结点//(不再指向头)如果不是第一个结点,尾指针指向无需改变 if(list->size == 0){list->last = s;}list->size++;return true;}
致命错误!!!
百般思索才找到问题的原因所在:
/*头插法:开辟并初始化--->>连接---->>指针后移 !!**注意特殊情况**!!*/
/**/用的不配对!!!
该为下列代码即可
//头插法:开辟并初始化--->>连接---->>指针后移 !!**注意特殊情况**!!
omg愿不再犯
0 0
- unexpected end of file found in comment
- unexpected end of file found in comment
- fatal error C1071: unexpected end of file found in comment
- VS2012 error C1071: unexpected end of file found in comment
- VS2013,fatal error C1071: unexpected end of file found in comment
- unexpected end of file found
- unexpected end of file found
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- unexpected end of file
- fatal error RC1004: unexpected end of file found处理方法
- error RC1004: unexpected end of file found处理方法
- fatal error RC1004: unexpected end of file found处理方法
- fatal error RC1004: unexpected end of file found
- VS: fatal error RC1004: unexpected end of file found
- fatal error C1004: unexpected end of file found
- VC++ fatal error RC1004: unexpected end of file found
- : gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive
- Parse error: syntax error, unexpected end of file in
- mvc中下拉框如何绑定枚举值
- Qt多界面编程
- 一种高性能网络游戏服务器架构设计
- 【转】什么是ROM、RAM、DRAM、SRAM和FLASH的区别
- [水+整数分解] poj 1365 Prime Land
- unexpected end of file found in comment
- HDU2578.Dating with girls(1)——二分
- java基础5
- 广州淘宝培训 广州维度电商培训 www.wedu88.com
- Valid Palindrome
- 一种高性能网络游戏服务器架构设计
- HDU3763.CD——二分
- 机器学习--朴素贝叶斯算法
- VS 环境路径