Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question about Parameters, Arguments in C

Status
Not open for further replies.

E-design

Advanced Member level 5
Joined
Jun 1, 2002
Messages
2,014
Helped
507
Reputation
1,016
Reaction score
408
Trophy points
1,363
Activity points
14,193
The following confuses me

In programming C, I read that Arguments can/are also called Parameters, now

can we say that a Formal Parameter is also a Parameter? If so,

can a Formal Parameter also be called an Argument?

Reading various sources I get conflicting explanations.
 

Hi,
Formal Parameters are devied into 2 categories: call-by-value parameters, call-by-reference parameters. (Of course addition to formal parameters is actual parameters)
So, formal parameters are parameters.
 

So are they also Arguments?
 

If we take a function prototype:
void funct(int a, int b);
then a and b are the functions parameters.
If we call it:
funct(1, 2);
then 1 and 2 are the arguments to the function.
 

when we call function passing variable call arguments where recieving function body variables are parametre.
 

The data type of a parameter is to be the same as that of a corresponding parameter. If a non-address type is used, we usually call it call-by-value. If we use an address type, then, we call it call-by-reference.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top