代码发布我的代码已停止 [英] Code issue my code is stopped
问题描述
在公共场合我如何创建一个get节点(我的意思是一个函数原型)
只需要一个help.please容易理解的指南.
类库
{
公众:
私人:
结构日期
{
诠释日;
int年;
char mon [10];
};
struct recordnode
{
字符标题[60];
char作者[47];
char subj [20];
日期发布;
字符串状态; <br/>
int numofcopies;
recordnode *上一页;
recordnode * next;
}
IN public how i can create a get node(i mean a function prototype)
need just one help.please guide in easy that i can understand.
class Lib
{
public:
private:
struct date
{
int day;
int year;
char mon[10];
};
struct recordnode
{
char title[60];
char author[47];
char subj[20];
date pub;
string status;
int numofcopies;
recordnode * prev;
recordnode * next;
}
推荐答案
由于recordnode在函数声明之后,因此在类声明之前需要正向声明.
前向声明看起来像这样.它告诉编译器应该在以后期望数据定义.
Because recordnode comes after the function declaration, you''ll need a forward declaration before your class declaration.
A forward declaration looks like this. It tells the compiler that it should expect a data defintion later.
struct recordnode;
然后您的函数声明可能看起来像这样.
Then your function declaration might look like this.
recordnode * CreateNewRecordNode(void);
这篇关于代码发布我的代码已停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!