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

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. ?

Laxman said:   1 decade ago
What are linkage? Tell briefly.

Syeda said:   1 decade ago
For increment operators why we are begining from right most?

Its left priority right?

OP Meena said:   1 decade ago
@Vidya.

String variabls can not directly compare by using == operator,

string variable compare by using the strcmp() function in c and c++,
like:
if(strcmp(str1,str2)==0)) printf("String are eqals");

In Java we compare the string by using the equals() method.

Vittu agrawal said:   1 decade ago
What is static and non static variables and functions ?

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


Post your comments here:

Your comments will be displayed after verification.