unexpected end of file found in comment
2015-04-28 20:33
453 查看
今天调试程序遇到下面一个错误:
unexpected end of file found in comment
致命错误!!!
百般思索才找到问题的原因所在:
/**/用的不配对!!!
该为下列代码即可
omg愿不再犯
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愿不再犯
相关文章推荐
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- VS2012 error C1071: unexpected end of file found in comment
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- fatal error C1071: unexpected end of file found in comment
- fatal error C1071: unexpected end of file found in comment
- fatal error C1071: unexpected end of file found in comment
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- unexpected end of file found in comment
- VS2013,fatal error C1071: unexpected end of file found in comment
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- 使用VC6.0编译C++代码的时候报错:fatal error C1071: unexpected end of file found in comment(Mark ZZ)
- PHP问题Parse error: syntax error, unexpected end of file in
- vc++ resource.h文件出现“fatal error RC1004: unexpected end of file found”问题 .
- gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive ta
- Parse error: syntax error, unexpected end of file in * 的解决办法
- : gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive
- VS: fatal error RC1004: unexpected end of file found
- PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
- fatal error RC1004: unexpected end of file found处理方法