Call of a structure inside a function

Structure:
1
2
3
4
  struct yes
{
    int row,column;
}stack[5001];


Function:
 
  void check(int v[5001][5001],int i,int j,int k,struct stack[5001],int &size)


Call:
 
  check(v,i,j,k,stack,size);


error: cannot convert 'yes' to 'struct*' for argument '5' to 'void check(int (*)[5001], int, int, int, object_names*, int&)'|
Last edited on
You don't have a type name stack, stack is a variable not a type. Your function should look more like (if you're using a C compiler):

void check(int v[5001][5001],int i,int j,int k,struct yes *stack, int &size)

(if you're using a C++ compiler):
void check(int v[5001][5001],int i,int j,int k,yes *stack, int &size)

You don't seem to realize that you're creating a global variable of type yes named stack that is an array with a size of 5001 when you defined that structure.
Topic archived. No new replies allowed.