Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing struct pointer to function

Status
Not open for further replies.

Mungovan

Programmer
Oct 24, 2002
94
IE
Hi.

This is my boggle: I have a structure defined and typedef'd to "node".

I want to pass a pointer to the node to a function called highNode.

At the start of the program I have the definition:

void highNode(node *n);

then in the program itself I do:

int *node_ptr;
node_ptr = &node;
highNode(node_ptr);

Then at the end of the program I write the function with:

void highNode(node *n){ ##
//operations on n.
}

But the error I'm getting is at line ## saying:

"highNode:local function definitions are illegal"

Any ideas??

Thanks
D




 
Have you closed you main function before you begin the definition of the highNode function? ______________________________________________________________________
TANSTAAFL!
 
You'r right, I didn't notice that last curly brackets right at the end.
Thanks.

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top