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.

Ashwini said:   9 years ago
What is the difference between that all three linkages?

Sarathi said:   10 years ago
Difference between GCC and TCC compiler?

Saiba Murmu said:   1 decade ago
It gives result according to the compiler.

GCC compiler gives Result: 9.

TCC compiler gives Result: 8.

Explanation:

In GCC compiler, variables are stored in stack memory area. First value 4 is stored after incrementing by the pre-increment operator then second value 5 is stored after increment. So the Result is 9.

But in case of TCC compiler first value 4 is stored in stack then before increment the second value of x=4 is stored. So the Result is 8.

Manoj said:   1 decade ago
@Kavitha.

It will give the output 8 only!

Kasthuri said:   1 decade ago
@Kavitha.

It will give only 8 as the output.

Kavitha said:   1 decade ago
#include<stdio.h>
int main()
{
int x=3;
int z;
z=++x + x++;
printf("%d",z);
}

It gives the output 9,how?

Tiger said:   1 decade ago
@Karthick we use the return in the program because the return any value for example.

#include<stdio.h>
int main()
{
int i=5;
return i;
}

Output of the above program is 5 because it will be return the value of the i.

Karthick said:   1 decade ago
Why we use return in program?

Priya said:   1 decade ago
You must initialize the i with a value because it will take a garbage value by default.

Gowthami said:   1 decade ago
What is meant by external linkage?


Post your comments here:

Your comments will be displayed after verification.