C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 2)
2.
What are the types of linkages?
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.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Discussion:
95 comments Page 5 of 10.
Anil said:
9 years ago
#include <stdio.h>
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
Output = 6.
How is it possible? Please give me an explanation.
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
Output = 6.
How is it possible? Please give me an explanation.
BALAMURUGAN said:
9 years ago
How you can classify those linkages respectively. Please tell me.
Ashwini said:
9 years ago
@Saiba Murmu.
GCC compiler also giving the result : 8.
Check it once.
GCC compiler also giving the result : 8.
Check it once.
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.
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.
Kasthuri said:
1 decade ago
@Kavitha.
It will give only 8 as the output.
It will give only 8 as the output.
Manoj said:
1 decade ago
@Kavitha.
It will give the output 8 only!
It will give the output 8 only!
Silpi roy said:
1 decade ago
What are linkages?
Sameer said:
1 decade ago
What is the meaning of functions of filescope?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers