Stewart
Stewart

Reputation: 21

Linkage of formal parameters

I have a function say foo defined as

void foo (int foo_arg)
{
  printf("%d",foo_arg);
}

What is the linkage type of foo_arg?

Upvotes: 1

Views: 84

Answers (1)

Prasoon Saurav
Prasoon Saurav

Reputation: 92864

In C there are three kinds of linkage: external, internal, and none.

Formal parameters have no linkage

Section 6.2.2/6 (ISO C99)

The following identifiers have no linkage:

  • an identifier declared to be anything other than an object or a function;
  • an identifier declared to be a function parameter;
  • a block scope identifier for an object declared without the storage-class specifier extern.

Also read this thread.

Upvotes: 6

Related Questions