C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 2)
2.
What are the types of linkages?
Internal and External
External, Internal and None
External and None
Internal
Answer: Option
Explanation:
External Linkage-> means global, non-static variables and functions.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Discussion:
95 comments Page 3 of 10.

Manukumar said:   1 decade ago
What is linkages? how it affects the c program in terms of memory or storage class?

Bhavani said:   1 decade ago
@Moumita.

When x=5 then,

Z=++x + ++x;

Is printing 14 not 13.
I checked it guys,

x = 7 at last, Because a value of a variable(x) vl hold the latest value that's being stored in the memory(i.e) 7.

So z = 7+7 = 14.

Mounika said:   1 decade ago
13 because here first x = 5.
Then ++x = 6(pre increment).

Now x = 6.
Then ++x = 7.

So z = ++x + ++x.
z = 6+7 => 13.

Moumita said:   1 decade ago
Guys please check this once more.

When x =5 then,

Z=++x + ++x;

Is printing 13 not 14....

So what is the actual explanation?

Vams said:   1 decade ago
@Aliya.

C compiler does parsing (reading and evaluating) from left to right of each line of code. That is purely related to compiler design(cd) topic for further details refer cd of C language.

Lavanya said:   1 decade ago
Give details of linkages & when they are used?

Sruthi said:   9 years ago
What is a linkage?

Sreenu said:   7 years ago
What is meant by linkages?

Vineethreddy said:   7 years ago
Pre increment - increment the value and then use it.

Post increment - use the value and then increment.

Prabhat said:   7 years ago
Pre-increment and post-increment behaviour depends on the compiler's implementation of it.

Each compiler can give you the different result for the same operation with respect to pre and post increment and decrement. As there is no standard behaviour defined by ANSI C standard.

We shouldn't use these two operators in an expression.


Post your comments here:

Your comments will be displayed after verification.