【发布时间】:2013-07-24 15:12:08
【问题描述】:
我浏览了有关此的其他帖子,但没有像我的问题那样。 我正在尝试从一个文件(1.l)访问结构。下面显示的是我在文件 1.l 中的结构声明和定义。
struct node
{
char words[50];
struct node *next;
};
struct node *head = NULL;
struct node *head1 = NULL;
我试图访问的文件是 2.l。 2.l如下图。
%{
#include "y.tab.h"
extern struct node *head1;
%}
%x SECTION
%%
"#pragma omp section" { BEGIN SECTION; yyless(0); }
<SECTION>"#pragma omp section" {
fprintf(yyout,"meta_fork");
while(head1 != NULL)
{
\\error in this line fprintf(yyout,"shared(%s)",head1->words);
\\error in this line head1 = head1->next;
}
}
%%
错误是取消引用指向不完整类型的指针。
谁能告诉我这里有什么问题。谢谢。
【问题讨论】:
-
我也尝试像下面那样定义我的 stuct *head1 但仍然遇到相同的错误。结构节点 *head1 { 字符字[50];结构节点*下一个; };
标签: pointers structure lex extern