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 5 of 10.

Amru said:   1 decade ago
What is the exact meaning of linkage? what exact it does. ?

Rakhi said:   1 decade ago
What are linkage?

Praveen said:   1 decade ago
@Raju.

Begin from the right most(x++).

x++ -> value remains 2,

Now ++x -> 2 incremented to 3. now x contains the final value 3 but it can't assign post increment.

Hence z = 3+2 = 5.

Sonali said:   1 decade ago
I'm still confuse in that z value, will it be 5 or 6? and how?

@Shibu and @ Praveen.

Alok said:   1 decade ago
@Sonali see this one.

z=(++x)+(++x)

For 1st ++x, the value of x is first increased about one and then assign, that means the value of x changes from 5 to 6.

Its clear in the same way the 2 nd ++x, x changes from 6 to 7.

So, final value of x is 7.
That means z = x+x.

For 1st and 2nd x's the value is same that is 7.

Therefore Z = 7+7.

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

Gaurav said:   1 decade ago
@Praveen.

Why x++ value remains 2?

Why it is not incremented by 1?

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

Aliya said:   1 decade ago
@Praveen:

Why the evaluation is done from the right most i.e; x++.

++x=3; the value of x=3.

x++=3; we do not increment here since its a post inc.

++x + x++ = 6?

Why aren't we considering pre inc first?

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.


Post your comments here:

Your comments will be displayed after verification.