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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaring parameters in function header

Status
Not open for further replies.

KarlSciberras

Programmer
Dec 8, 2006
9
MT
Note the following piece of code:

Code:
int func (myval) 
  int myval;  
{
  //statements...
}

The code below, seems to me the equivalent:

Code:
int func (int myval) 
{
  //statements...
}

My questions are:

1. What is the difference between the two pieces of code ?
2. Are there any advantages of using one method instead of the other ?
 
The first example is classic C from the mysts of time...

The second example is the more recent ANSI version.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top