1. You have no meaningful indentation in your code. It is difficult to see scopes.
2. Where in the code do you need help? What there is to fix? What errors (exactly) do you have? You will be a step closer to solving your problems on your own, when you learn to describe each issue.
The compiler you use compiles this code without any remark? www.cpp.sh shows:
In function 'void minimumspanningtree(int*, int (*)[99], int, int)':
31:1: error: 'temp' was not declared in this scope
39:6: error: 'struct node' has no member named 'to'
42:3: error: 'temp' was not declared in this scope
In function 'int main()':
67:31: error: cannot convert 'int (*)[7]' to 'int (*)[99]' for argument '2' to 'void minimumspanningtree(int*, int (*)[99], int, int)'
68:7: error: 'getch' was not declared in this scope
69:1: error: 'pnode' was not declared in this scope
69:12: error: 'temp' was not declared in this scope