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,

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

Missing ; after } for class prototype:

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

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++.

:$ You are absolutely right.