myinfro1.h

来自「词法分析程序」· C头文件 代码 · 共 38 行

H
38
字号
#if !defined THISISINFROMANTION
#define THISISINFROMANTION
#include "Node.h"
///以下都是全局变量
//记录输出信息
Node outputfront;//这里存结果输出信息
Node errorfront;//这里存错误输出信息
//以上变量在各自view里初始化
int output_linenum=0;
int error_linenum=0;
////////my fuction
void insertline(Node* node,int* linenum,char* string)
{
	int len=strlen(string);
	Node* temp=node;
	while(temp->next)
	{
		temp=temp->next;
	}
	temp->next=new Node;
	temp->next->next=NULL;
	temp->next->pchar=new char[len+1];
	strcpy(temp->next->pchar,string);
	*linenum+=1;	
}
void freenode(Node* node,int* linenum)
{
	Node* temp;
	while(node->next)
	{
		temp=node->next;
		node->next=node->next->next;
		delete [] temp->pchar;
		delete temp;
	}
	*linenum=0;	
}
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?