0

hi,

How can i pass a stack to the function. I am getting compilation error. Following is my code.

class circuit
{
        public:
        int append_and_file(stack<int> &);
        /* Some other variables defined */
}

int circuit::unroll()
{
        append_and_file(add_stack_ppi);
}
int circuit::append_and_file(stack<int> &stack_ref)
{
	int var=0;
	int num_clauses = 0;
        stack_ref.push(2);
}

Please tell me what is wrong.

Thanks,

4
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Comatose
0

Did you declare unroll?
Do you have the error log?
Did you even bother to read the forum rules; that you have violated?

0

Missing ; after } for class prototype:

class circuit
{
public:
     int append_and_file(stack<int> &);
     /* Some other variables defined */
};
0

Missing ; after } for class prototype:

class circuit
{
public:
     int append_and_file(stack<int> &);
     /* Some other variables defined */
};

Remark: this constuct called class definition in C++.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.