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

Ago balan said:   1 decade ago
int a; --> Here a is a variable of integer. We can increment the value of a using for loop.

static int a; --> Whenever 'a' is called at any line in a program 'a' value is assigned automatically that value is previous value of a we used sometime earlier in program. Actually static is storage class.

Suresh said:   2 decades ago
What is static variable?

Vidya said:   1 decade ago
main() {
char str1[]="Hello";
char str2[]="Hello";
if ( str1==str2 )
printf("True");
else
printf("False");
}
ans:false
please explain the answer

Gaurav said:   1 decade ago
@Praveen.

Why x++ value remains 2?

Why it is not incremented by 1?

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

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.

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

@Shibu and @ Praveen.

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.

Rakhi said:   1 decade ago
What are linkage?

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


Post your comments here:

Your comments will be displayed after verification.